__wasi_proc_exit
__wasi_random_get
__wasi_sched_yield
+__wasi_sock_accept
__wasi_sock_recv
__wasi_sock_send
__wasi_sock_shutdown
#define __WASI_RIGHTS_PATH_SYMLINK ((__wasi_rights_t)(1 << 24))
#define __WASI_RIGHTS_PATH_UNLINK_FILE ((__wasi_rights_t)(1 << 26))
#define __WASI_RIGHTS_POLL_FD_READWRITE ((__wasi_rights_t)(1 << 27))
+#define __WASI_RIGHTS_SOCK_ACCEPT ((__wasi_rights_t)(1 << 29))
#define __WASI_RIGHTS_SOCK_SHUTDOWN ((__wasi_rights_t)(1 << 28))
#define __WASI_ROFLAGS_RECV_DATA_TRUNCATED ((__wasi_roflags_t)(1 << 0))
#define __WASI_SDFLAGS_RD ((__wasi_sdflags_t)(1 << 0))
__imported_wasi_snapshot_preview1_proc_exit
__imported_wasi_snapshot_preview1_random_get
__imported_wasi_snapshot_preview1_sched_yield
+__imported_wasi_snapshot_preview1_sock_accept
__imported_wasi_snapshot_preview1_sock_recv
__imported_wasi_snapshot_preview1_sock_send
__imported_wasi_snapshot_preview1_sock_shutdown
*/
#define __WASI_RIGHTS_SOCK_SHUTDOWN ((__wasi_rights_t)(1 << 28))
+/**
+ * The right to invoke `sock_accept`.
+ */
+#define __WASI_RIGHTS_SOCK_ACCEPT ((__wasi_rights_t)(1 << 29))
+
/**
* A file descriptor handle.
*/
/**
* Read command-line argument data.
- * The size of the array should match that returned by `args_sizes_get`
+ * The size of the array should match that returned by `args_sizes_get`.
+ * Each argument is expected to be `\0` terminated.
*/
__wasi_errno_t __wasi_args_get(
uint8_t * * argv,
/**
* Read environment variable data.
* The sizes of the buffers should match that returned by `environ_sizes_get`.
+ * Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.
*/
__wasi_errno_t __wasi_environ_get(
uint8_t * * environ,
uint8_t * buf,
__wasi_size_t buf_len
) __attribute__((__warn_unused_result__));
+/**
+ * Accept a new incoming connection.
+ * Note: This is similar to `accept` in POSIX.
+ * @return
+ * New socket connection
+ */
+__wasi_errno_t __wasi_sock_accept(
+ /**
+ * The listening socket.
+ */
+ __wasi_fd_t fd,
+ /**
+ * The desired values of the file descriptor flags.
+ */
+ __wasi_fdflags_t flags,
+ __wasi_fd_t *retptr0
+) __attribute__((__warn_unused_result__));
/**
* Receive a message from a socket.
* Note: This is similar to `recv` in POSIX, though it also supports reading
return (uint16_t) ret;
}
+int32_t __imported_wasi_snapshot_preview1_sock_accept(int32_t arg0, int32_t arg1, int32_t arg2) __attribute__((
+ __import_module__("wasi_snapshot_preview1"),
+ __import_name__("sock_accept")
+));
+
+__wasi_errno_t __wasi_sock_accept(
+ __wasi_fd_t fd,
+ __wasi_fdflags_t flags,
+ __wasi_fd_t *retptr0
+){
+ int32_t ret = __imported_wasi_snapshot_preview1_sock_accept((int32_t) fd, flags, (int32_t) retptr0);
+ return (uint16_t) ret;
+}
+
int32_t __imported_wasi_snapshot_preview1_sock_recv(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5) __attribute__((
__import_module__("wasi_snapshot_preview1"),
__import_name__("sock_recv")
-Subproject commit ef8c1a53feb2dfb763d4ea5c7d9e0a0126b45579
+Subproject commit 59cbe140561db52fc505555e859de884e0ee7f00