]> git.proxmox.com Git - wasi-libc.git/commitdiff
build: update WASI and partially regenerate `api.h`
authorRoman Volosatovs <rvolosatovs@riseup.net>
Mon, 4 Apr 2022 15:39:21 +0000 (17:39 +0200)
committerDan Gohman <dev@sunfishcode.online>
Wed, 20 Apr 2022 20:39:57 +0000 (13:39 -0700)
expected/wasm32-wasi/defined-symbols.txt
expected/wasm32-wasi/predefined-macros.txt
expected/wasm32-wasi/undefined-symbols.txt
libc-bottom-half/headers/public/wasi/api.h
libc-bottom-half/sources/__wasilibc_real.c
tools/wasi-headers/WASI

index 543d33e1162942ce2b49670e009b79c169b8c15f..fb7234a0249a50e2f05129879e295a84e1756a0a 100644 (file)
@@ -300,6 +300,7 @@ __wasi_poll_oneoff
 __wasi_proc_exit
 __wasi_random_get
 __wasi_sched_yield
+__wasi_sock_accept
 __wasi_sock_recv
 __wasi_sock_send
 __wasi_sock_shutdown
index a48808acb6cdad8ee8ada791e2276b92c1e33f10..5248cb2e071a88d0ca76e347e253a668a164fbed 100644 (file)
 #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))
index 4b3d265e58461bf16dfba78653b2eec763773369..7a659e776bbf7ca8dbd1c7ff2534e5e11eceb2ed 100644 (file)
@@ -52,6 +52,7 @@ __imported_wasi_snapshot_preview1_poll_oneoff
 __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
index 81dba35cafedef69f0617f11e5237622d0017e41..7bbe93508e8468070ad5ca58c62e0609f548212e 100644 (file)
@@ -657,6 +657,11 @@ typedef uint64_t __wasi_rights_t;
  */
 #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.
  */
@@ -1394,7 +1399,8 @@ _Static_assert(_Alignof(__wasi_prestat_t) == 4, "witx calculated align");
 
 /**
  * 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,
@@ -1413,6 +1419,7 @@ __wasi_errno_t __wasi_args_sizes_get(
 /**
  * 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,
@@ -2005,6 +2012,23 @@ __wasi_errno_t __wasi_random_get(
     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
index 37ca7d95a1f306af6db408740333b564540b4157..370e09575f63fa985177607afc91c8ce6a6aaa4a 100644 (file)
@@ -599,6 +599,20 @@ __wasi_errno_t __wasi_random_get(
     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")
index ef8c1a53feb2dfb763d4ea5c7d9e0a0126b45579..59cbe140561db52fc505555e859de884e0ee7f00 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ef8c1a53feb2dfb763d4ea5c7d9e0a0126b45579
+Subproject commit 59cbe140561db52fc505555e859de884e0ee7f00