Is it allowed to pass file descriptors 0, 1 and 2 to fd_prestat_get ?
I tried it in wasmtime
and it returns Bad file descriptor
while wasmer
returns Ok()
with a Prestat
struct for the corresponding fd (i.e. stdin for fd = 0 , stdout for fd =1 , stderr for fd = 2).
which behavior is correct ?
for context: I am comparing different wasi implementations between engines, initially I am working on wasmer and wasmtime. I am also using this crate to use the wasi api
afaik "preopened" is only meaningful for directories currently
Which is slightly confusing since other fds provided by the host are in some sense pre-opened...
https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/witx/typenames.witx#L728-L734
Last updated: Dec 23 2024 at 13:07 UTC