@@ -657,6 +657,11 @@ typedef uint64_t __wasi_rights_t;
657657 */
658658#define __WASI_RIGHTS_SOCK_SHUTDOWN ((__wasi_rights_t)(1 << 28))
659659
660+ /**
661+ * The right to invoke `sock_accept`.
662+ */
663+ #define __WASI_RIGHTS_SOCK_ACCEPT ((__wasi_rights_t)(1 << 29))
664+
660665/**
661666 * A file descriptor handle.
662667 */
@@ -1394,7 +1399,8 @@ _Static_assert(_Alignof(__wasi_prestat_t) == 4, "witx calculated align");
13941399
13951400/**
13961401 * Read command-line argument data.
1397- * The size of the array should match that returned by `args_sizes_get`
1402+ * The size of the array should match that returned by `args_sizes_get`.
1403+ * Each argument is expected to be `\0` terminated.
13981404 */
13991405__wasi_errno_t __wasi_args_get (
14001406 uint8_t * * argv ,
@@ -1413,6 +1419,7 @@ __wasi_errno_t __wasi_args_sizes_get(
14131419/**
14141420 * Read environment variable data.
14151421 * The sizes of the buffers should match that returned by `environ_sizes_get`.
1422+ * Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.
14161423 */
14171424__wasi_errno_t __wasi_environ_get (
14181425 uint8_t * * environ ,
@@ -2005,6 +2012,23 @@ __wasi_errno_t __wasi_random_get(
20052012 uint8_t * buf ,
20062013 __wasi_size_t buf_len
20072014) __attribute__((__warn_unused_result__ ));
2015+ /**
2016+ * Accept a new incoming connection.
2017+ * Note: This is similar to `accept` in POSIX.
2018+ * @return
2019+ * New socket connection
2020+ */
2021+ __wasi_errno_t __wasi_sock_accept (
2022+ /**
2023+ * The listening socket.
2024+ */
2025+ __wasi_fd_t fd ,
2026+ /**
2027+ * The desired values of the file descriptor flags.
2028+ */
2029+ __wasi_fdflags_t flags ,
2030+ __wasi_fd_t * retptr0
2031+ ) __attribute__((__warn_unused_result__ ));
20082032/**
20092033 * Receive a message from a socket.
20102034 * Note: This is similar to `recv` in POSIX, though it also supports reading
0 commit comments