Open pavelsavara opened 2 months ago
We do already support both blocking and non-blocking sockets (e.g. https://github.com/WebAssembly/wasi-libc/blob/1b19fc65ad84b223876c50dd4fcd7d5a08c311dc/libc-bottom-half/headers/public/__header_sys_socket.h#L55 and https://github.com/WebAssembly/wasi-libc/blob/1b19fc65ad84b223876c50dd4fcd7d5a08c311dc/libc-bottom-half/sources/socket.c#L92), so presumably adding O_NONBLOCK
support for toggling that should be pretty trivial.
BTW, we do already support setting FIONBIO
on sockets via ioctl
. I don't think there's a way to read the current state yet, though.
fcntl
doesn't implementO_NONBLOCK
forwasi:socket
handlesSee https://github.com/WebAssembly/wasi-libc/blob/1b19fc65ad84b223876c50dd4fcd7d5a08c311dc/libc-bottom-half/cloudlibc/src/libc/fcntl/fcntl.c#L10-L61