diff --git a/libc-test/semver/wasi-p2.txt b/libc-test/semver/wasi-p2.txt index 2d1bc774ab30..31ab3679baff 100644 --- a/libc-test/semver/wasi-p2.txt +++ b/libc-test/semver/wasi-p2.txt @@ -24,9 +24,7 @@ SHUT_RD SHUT_RDWR SHUT_WR SOCK_DGRAM -SOCK_NONBLOCK SOCK_STREAM -SOL_SOCKET SO_ACCEPTCONN SO_BROADCAST SO_DOMAIN @@ -39,7 +37,6 @@ SO_RCVTIMEO SO_REUSEADDR SO_SNDBUF SO_SNDTIMEO -SO_TYPE TCP_KEEPCNT TCP_KEEPIDLE TCP_KEEPINTVL diff --git a/libc-test/semver/wasi.txt b/libc-test/semver/wasi.txt index 5e7ab4b5192c..510c73fd16e7 100644 --- a/libc-test/semver/wasi.txt +++ b/libc-test/semver/wasi.txt @@ -1,6 +1,10 @@ FD_ISSET FD_SET FD_ZERO +SOCK_CLOEXEC +SOCK_NONBLOCK +SOL_SOCKET +SO_TYPE _SC_2_CHAR_TERM _SC_2_C_BIND _SC_2_C_DEV diff --git a/src/wasi/mod.rs b/src/wasi/mod.rs index ac8212c6baf1..6eb19ac23bf9 100644 --- a/src/wasi/mod.rs +++ b/src/wasi/mod.rs @@ -652,6 +652,13 @@ pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1; pub const PTHREAD_STACK_MIN: usize = 2048; pub const TIMER_ABSTIME: c_int = 1; +pub const SOCK_CLOEXEC: c_int = 0x00002000; +pub const SOCK_NONBLOCK: c_int = 0x00004000; + +pub const SOL_SOCKET: c_int = 0x7fffffff; + +pub const SO_TYPE: c_int = 3; + f! { pub unsafe fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { let set = &*set; diff --git a/src/wasi/p2.rs b/src/wasi/p2.rs index 7332a779396d..2a724ac061c1 100644 --- a/src/wasi/p2.rs +++ b/src/wasi/p2.rs @@ -79,7 +79,6 @@ pub const MSG_NOSIGNAL: c_int = 0x4000; pub const MSG_PEEK: c_int = 0x0002; pub const SO_REUSEADDR: c_int = 2; -pub const SO_TYPE: c_int = 3; pub const SO_ERROR: c_int = 4; pub const SO_BROADCAST: c_int = 6; pub const SO_SNDBUF: c_int = 7; @@ -94,9 +93,6 @@ pub const SO_SNDTIMEO: c_int = 67; pub const SOCK_DGRAM: c_int = 5; pub const SOCK_STREAM: c_int = 6; -pub const SOCK_NONBLOCK: c_int = 0x00004000; - -pub const SOL_SOCKET: c_int = 0x7fffffff; pub const AF_UNSPEC: c_int = 0; pub const AF_INET: c_int = 1;