diff --git a/legacy/application-abi.md b/legacy/application-abi.md index a87f9d27..39373da6 100644 --- a/legacy/application-abi.md +++ b/legacy/application-abi.md @@ -51,6 +51,13 @@ Regardless of the kind, all modules accessing WASI APIs also export a table with the name `__indirect_function_table`. Function pointers in WASI API calls are relative to this table's index space. +When `_start` or `_initialize` is called, environments shall provide file +descriptors with indices 0, 1, and 2 representing stream resources for +standard input, standard output, and standard error. Environments may provide +additional "preopen" file descriptors that can be inspected with +`fd_prestat_get` and `fd_prestat_dir_name`. These resources may be closed at +any time. + Environments shall not access exports named `__heap_base` or `__data_end`. Toolchains are encouraged to avoid providing these exports.