build: update WASI and partially regenerate api.h

This commit is contained in:
Roman Volosatovs 2022-04-04 17:39:21 +02:00 committed by Dan Gohman
parent 05cd0af0af
commit 7302f33f99
6 changed files with 43 additions and 2 deletions

View 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

View File

@ -2954,6 +2954,7 @@
#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))

View 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

View 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

View 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")

@ -1 +1 @@
Subproject commit ef8c1a53feb2dfb763d4ea5c7d9e0a0126b45579
Subproject commit 59cbe140561db52fc505555e859de884e0ee7f00