You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I experiment with userland unix in Go and your project looks like a perfect match allowing me to run a unix utilities. After I build a few of them and tested them, I have noticed the fclose <stdin>: Bad file descriptor appeared. It happens for os.Stdin, bytes.Buffer or the *io.PipeReader. The io.NopCloser has no effect there. So I believe this is nothing to do with Go, but with the wasi integration of fclose.
This allows wasm to close stdio file descriptors such as STDOUT(1).
This will not close the underlying host resource as that would break a
lot of folks doing logging to the console.
Fixes#953
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Allows wasm to close stdio file descriptors
This allows wasm to close stdio file descriptors such as STDOUT(1).
This will not close the underlying host resource as that would break a
lot of folks doing logging to the console.
Fixes#953
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Describe the bug
I experiment with userland unix in Go and your project looks like a perfect match allowing me to run a unix utilities. After I build a few of them and tested them, I have noticed the
fclose <stdin>: Bad file descriptor
appeared. It happens foros.Stdin
,bytes.Buffer
or the*io.PipeReader
. Theio.NopCloser
has no effect there. So I believe this is nothing to do with Go, but with the wasi integration offclose
.To Reproduce
A small C reproducer
To wasm -
zig cc --target=wasm32-wasi fclose.c -o fclose.wasm
Run it via this program
Expected behavior
The stdin is closed, no error message appear and exit code is 0.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the relevant information):
The text was updated successfully, but these errors were encountered: