Ben FWIW I think it's reasonable to mostly go ahead and land https://github.com/WebAssembly/wasi-libc/pull/883 where it's at with notes on various follow-ups. I feel that it's in a reasonable enough shape for prototyping/testing and as a blocker for doing lots of other stuff I think it's ok to not try to get it absolutely perfect before landing (insofar as while I could debate stdio further I think we're in the diminishing returns phase)
Sounds good. Thanks for all your feedback; I do think it's in a much better overall place now. I'll try and get the testing stuff figured out soon + stdout as a TTY and then try to get it landed.
And then I guess the next thing would be to pull it into wasi-sdk, and then at that point hopefully we're able to start doing some end-to-end iteration.
Ryan and I are also working through reviews on a lot of the Firefox implementation, so hopefully it won't be too long before we can even start writing some early docs.
Finally back to finish up the last couple things and get this merged. @Alex Crichton, I have a weird confluence of problems around __clock_nanosleep and futexes. One of the tests is going into an infinite loop of "Uncaught Error: clock_nanosleep is not supported" because musl's __timedwait isn't prepared for ENOSYS.
Specifically this, I think: https://github.com/WebAssembly/wasi-libc/blob/main/libc-top-half/musl/src/thread/common/__timedwait.c#L62
As this works through the whole system it gets down to __clock_nanosleep, which logs and returns ENOSYS, which ends up here as -ENOSYS, which then isn't on the list of approved errors (EINTR, ETIMEDOUT, ECANCELED) and therefore returns...0.
So the error just gets masked in this really dumb way. It seems this used to trap before you did https://github.com/WebAssembly/wasi-libc/pull/900
But it's not clear to me what the right fix is. Adding ENOSYS to that list of errors seems wrong, and honestly trapping would probably be fine, so should I just update futex.c to go back to unconditionally trapping for webp2?
should I just update futex.c to go back to unconditionally trapping for webp2?
I think that's reasonable yeah, this sounds like basically the same bucket as sleep where errors either cannot be, or cannot practically be, communicated
I also have some new test failures because you can't set O_NONBLOCK on webp2's stdio. Suggestions on how to handle that one?
Hm, maybe I can persuade those tests to pass
Yeah false alarm there, I can just roundtrip the nonblocking flag and those pass
I think it's ready for what I hope is one last look. The only outstanding comments are about UTF-8 validation (where I would prefer to keep it the same) and wasmtime version shenanigans. Maybe I'll just poke around in the meantime and see if I could resolve the wasmtime version issue now.
Thanks again for your work here!
Last updated: Nov 19 2026 at 20:05 UTC