mirror of
https://git.proxmox.com/git/wasi-libc
synced 2026-02-01 17:52:22 +00:00
* Lazy-initialize the environment variables. This is the first in a series of PRs to make it easier to use WASI libc in Wasm modules that don't have a `main` function. By initializing the environment on demand, we avoid depending on having `__wasm_call_ctors` run. This uses weak symbols strategically to ensure that if `environ` is used, it is initialized eagerly, but if only `getenv` and friends are used, the environment is initialized lazily. Eventually, I expect we'll have a convention for wasm modules without main functions which will allow the `__wasm_call_ctors` function to be called automatically, but this helps in simple cases for now. Fixes #180. * Add comments explaining the libc-environ-compat.h header usage. |
||
|---|---|---|
| .. | ||
| __main_argc_argv.c | ||
| __main_void.c | ||
| __original_main.c | ||
| __wasilibc_fd_renumber.c | ||
| __wasilibc_initialize_environ.c | ||
| __wasilibc_rmdirat.c | ||
| __wasilibc_tell.c | ||
| __wasilibc_unlinkat.c | ||
| environ.c | ||
| errno.c | ||
| getentropy.c | ||
| isatty.c | ||
| pause.c | ||
| sbrk.c | ||
| string.c | ||
| truncate.c | ||