wasi-libc
wasi-libc copied to clipboard
Missing __WASI_RIFLAGS_RECV_DATA_TRUNCATED for MSG_TRUNC
WASI SDK 16.0 defines MSG_TRUNC as __WASI_RIFLAGS_RECV_DATA_TRUNCATED but never defines __WASI_RIFLAGS_RECV_DATA_TRUNCATED. This breaks code that uses MSG_TRUNC.
../../Modules/socketmodule.c:7870:29: error: use of undeclared identifier '__WASI_RIFLAGS_RECV_DATA_TRUNCATED'
PyModule_AddIntMacro(m, MSG_TRUNC);
^
/opt/wasi-sdk/bin/../share/wasi-sysroot/include/__header_sys_socket.h:16:19: note: expanded from macro 'MSG_TRUNC'
#define MSG_TRUNC __WASI_RIFLAGS_RECV_DATA_TRUNCATED
https://github.com/WebAssembly/wasi-libc/blob/60f221a400e36ba59d99c191a86e978117320f0a/libc-bottom-half/headers/public/__header_sys_socket.h#L14-L16
https://github.com/WebAssembly/wasi-libc/blob/60f221a400e36ba59d99c191a86e978117320f0a/libc-bottom-half/headers/public/wasi/api.h#L1309-L1317
See also https://github.com/WebAssembly/wasi-libc/issues/304 which is a similar issue.
__WASI_RIFLAGS_RECV_PEEK was anticipating adding sockets support to WASI using the witx IDL. The standards world that the witx IDL was meant to be layered on top of would radically evolve, to the point where many things in the witx IDL no longer make sense. The WASI Subgroup is now working towards a new milestone called Preview2, which uses the new wit IDL, and there is a full wasi-sockets proposal using wit. We're working on extending the wit-bindgen bindings generator to support the needed features, at which time we'll then extend wasi-libc with a full sockets API built on those bindings.