wasm-micro-runtime
wasm-micro-runtime copied to clipboard
lib-socket does not support getsockopt(SOL_SOCKET, SO_ERROR)
WAMR's socket support provides an implementation for getsockopt. However, when called with SOL_SOCKET, SO_ERROR it fails with __WASI_ERRNO_NOTSUP which causes some existing code to fail. There is support for handling many of the SOL_SOCKET options and having platform specific implementations (e.g., SO_RCVBUF). I'd propose to do the same for SO_ERROR.
For reference, SO_ERROR is used on getsockopt to return any pending errors on the socket and clears the error status value. Zero is returned if there are no errors.