I understand the O_CLOEXEC was for a fork/exec race condition. If it's specified to open
in wasi-sdk, is it just ignored?
Yes; O_CLOEXEC
is defined to be 0 on WASI.
WASI in the future will gain a way to spawn new programs which will likely need to be different from POSIX fork/exec, and as such, will likely avoid the whole O_CLOEXEC
situation. But it's also possible that libc will re-introduce a concept of child "processes" inheriting non-O_CLOEXEC
file descriptors as compatibility constructs to support existing code.
When that happens, O_CLOEXEC
will become significant. But for now, it's ignored.
Ok, thanks. Emscripten defines it as 0x80000 for some reason so I had a problem mixing emscripten object files with wasi-sdk. I shouldn't do that.....
Scott Waye has marked this topic as resolved.
Last updated: Dec 23 2024 at 12:05 UTC