Skip to content

Commit 9fbd75d

Browse files
committed
Implement WASI preopens
1 parent 659514d commit 9fbd75d

File tree

2 files changed

+305
-37
lines changed

2 files changed

+305
-37
lines changed

system/include/wasi/api.h

-13
Original file line numberDiff line numberDiff line change
@@ -1008,19 +1008,6 @@ typedef uint32_t __wasi_lookupflags_t;
10081008
_Static_assert(sizeof(__wasi_lookupflags_t) == 4, "witx calculated size");
10091009
_Static_assert(_Alignof(__wasi_lookupflags_t) == 4, "witx calculated align");
10101010

1011-
/**
1012-
* Default FD for the root folder.
1013-
* Why file descriptor 3?
1014-
* While not specified, the most common WASI implementation, wasi-libc, expects
1015-
* POSIX style file descriptor allocation, where the lowest available number is
1016-
* used to open the next file. Since 1 and 2 are taken by stdout and stderr,
1017-
* `root` is assigned 3.
1018-
* - https://github.com/WebAssembly/WASI/issues/122
1019-
* - https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_14
1020-
* - https://github.com/WebAssembly/wasi-libc/blob/wasi-sdk-16/libc-bottom-half/sources/preopens.c#L215
1021-
*/
1022-
#define __WASI_FD_ROOT 3
1023-
10241011
/**
10251012
* Open flags used by `path_open`.
10261013
*/

0 commit comments

Comments
 (0)