Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc-bottom-half/headers/public/__header_sys_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#define MSG_PEEK __WASI_RIFLAGS_RECV_PEEK
#define MSG_WAITALL __WASI_RIFLAGS_RECV_WAITALL
#define MSG_TRUNC __WASI_ROFLAGS_RECV_DATA_TRUNCATED
#define SOL_TCP 6
#define SOL_UDP 17
#elif defined(__wasip2__) || defined(__wasip3__)
#define MSG_DONTWAIT 0x0040
#define MSG_NOSIGNAL 0x4000
Expand Down
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,8 @@ add_external_entrypoint_test(external_entrypoint_pthread_tls.c)

# ========= sockets-related tests ===============================

add_wasilibc_test(socket-levels.c)

if (NOT (WASI STREQUAL "p1"))
add_wasilibc_test(poll-connect.c NETWORK)
add_wasilibc_test(poll-badfd.c)
Expand Down
6 changes: 6 additions & 0 deletions test/src/socket-levels.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <sys/socket.h>

_Static_assert(SOL_TCP == 6, "SOL_TCP must match the socket API value");
_Static_assert(SOL_UDP == 17, "SOL_UDP must match the socket API value");

int main(void) { return 0; }