aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2022-09-29 19:56:24 +0200
committerAndrew Kelley <andrew@ziglang.org>2022-10-03 22:48:57 -0400
commit8bbb022500f0dca91e4e7c8e2dcffec1eb383a93 (patch)
tree7c2831e8b21fac505e8a3d016a9196c7de34cd7b /lib/std
parent0d92c2ca5b13756d0b68e28d8921e3f63c2b6093 (diff)
downloadzig-8bbb022500f0dca91e4e7c8e2dcffec1eb383a93.tar.gz
zig-8bbb022500f0dca91e4e7c8e2dcffec1eb383a93.zip
std: WASI - update to latest snapshot preview 1
This implements the new addition to the API: `sock_accept`. Reference commit of WASI spec: 0ba0c5e2e37625ca5a6d3e4255a998dfaa3efc52 For full details: https://github.com/WebAssembly/WASI/commit/0ba0c5e2e37625ca5a6d3e4255a998dfaa3efc52 For entire spec at this commit: https://github.com/WebAssembly/WASI/blob/0ba0c5e2e37625ca5a6d3e4255a998dfaa3efc52/phases/snapshot/docs.md
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/os/wasi.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/std/os/wasi.zig b/lib/std/os/wasi.zig
index ec2c577de1..db6b4c930c 100644
--- a/lib/std/os/wasi.zig
+++ b/lib/std/os/wasi.zig
@@ -76,6 +76,7 @@ pub extern "wasi_snapshot_preview1" fn random_get(buf: [*]u8, buf_len: usize) er
pub extern "wasi_snapshot_preview1" fn sched_yield() errno_t;
+pub extern "wasi_snapshot_preview1" fn sock_accept(sock: fd_t, flags: fdflags_t, result_fd: *fd_t) errno_t;
pub extern "wasi_snapshot_preview1" fn sock_recv(sock: fd_t, ri_data: *const iovec_t, ri_data_len: usize, ri_flags: riflags_t, ro_datalen: *usize, ro_flags: *roflags_t) errno_t;
pub extern "wasi_snapshot_preview1" fn sock_send(sock: fd_t, si_data: *const ciovec_t, si_data_len: usize, si_flags: siflags_t, so_datalen: *usize) errno_t;
pub extern "wasi_snapshot_preview1" fn sock_shutdown(sock: fd_t, how: sdflags_t) errno_t;
@@ -434,6 +435,7 @@ pub const RIGHT = struct {
pub const PATH_UNLINK_FILE: rights_t = 0x0000000004000000;
pub const POLL_FD_READWRITE: rights_t = 0x0000000008000000;
pub const SOCK_SHUTDOWN: rights_t = 0x0000000010000000;
+ pub const SOCK_ACCEPT: rights_t = 0x0000000020000000;
pub const ALL: rights_t = FD_DATASYNC |
FD_READ |
FD_SEEK |
@@ -462,7 +464,8 @@ pub const RIGHT = struct {
PATH_REMOVE_DIRECTORY |
PATH_UNLINK_FILE |
POLL_FD_READWRITE |
- SOCK_SHUTDOWN;
+ SOCK_SHUTDOWN |
+ SOCK_ACCEPT;
};
pub const sdflags_t = u8;