Does WebAssembly/WASI have access to /proc/PID/fd/0, /dev/stdin and equivalent on Apple devices? #152
-
Does WebAssembly/WASI have access to WebAssembly/design#1521 (comment)
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
WASI does not specify anything about what files are present in the filesystem, or if any files from the host OS are available. In some embeddings where the WASI program is considered fully trusted, the whole host filesystem may be available, but most implementations choose to limit the part of the filesystem available to WASI to a small subset of the host. For how each implementation makes that choice, you can consult their docs. |
Beta Was this translation helpful? Give feedback.
The stdin and stdout streams use these interfaces in the wasi-cli package, which are distinct from the filesystem: https://github.com/WebAssembly/wasi-cli/blob/main/wit/stdio.wit . Rather than exposing those streams as files, they are exposed just as the more primitive input-stream and output-stream types from wasi-io. Additional information for implementing isatty is provided in these interfaces https://github.com/WebAssembly/wasi-cli/blob/main/wit/terminal.wit . One of the design principles in WASI is to use more specific types and interfaces, where possible, than the poxix principle of everything is a file.
WASI is specified using the Component Model wit language to define types and fu…