diff --git a/phases/snapshot/docs.md b/phases/snapshot/docs.md
index e91c22c82..657ce7a63 100644
--- a/phases/snapshot/docs.md
+++ b/phases/snapshot/docs.md
@@ -450,6 +450,11 @@ The right to invoke [`sock_shutdown`](#sock_shutdown).
Bit: 28
+- `sock_accept`: `bool`
+The right to invoke [`sock_accept`](#sock_accept).
+
+Bit: 29
+
## `fd`: `Handle`
A file descriptor handle.
@@ -2011,7 +2016,7 @@ The path at which to create the directory.
#### `path_filestat_get(fd: fd, flags: lookupflags, path: string) -> Result`
Return the attributes of a file or directory.
-Note: This is similar to `fstatat` in POSIX.
+Note: This is similar to `stat` in POSIX.
##### Params
- `fd`: [`fd`](#fd)
@@ -2414,6 +2419,33 @@ The buffer to fill with random data.
- `err`: [`errno`](#errno)
+---
+
+#### `sock_accept(fd: fd, flags: fdflags) -> Result`
+Accept a new incoming connection.
+Note: This is similar to `accept` in POSIX.
+
+##### Params
+- `fd`: [`fd`](#fd)
+The listening socket.
+
+- `flags`: [`fdflags`](#fdflags)
+The desired values of the file descriptor flags.
+
+##### Results
+- `error`: `Result`
+New socket connection
+
+###### Variant Layout
+- size: 8
+- align: 4
+- tag_size: 4
+###### Variant cases
+- `ok`: [`fd`](#fd)
+
+- `err`: [`errno`](#errno)
+
+
---
#### `sock_recv(fd: fd, ri_data: iovec_array, ri_flags: riflags) -> Result<(size, roflags), errno>`
diff --git a/phases/snapshot/witx/typenames.witx b/phases/snapshot/witx/typenames.witx
index 311b42233..893e5b288 100644
--- a/phases/snapshot/witx/typenames.witx
+++ b/phases/snapshot/witx/typenames.witx
@@ -270,6 +270,8 @@
$poll_fd_readwrite
;;; The right to invoke `sock_shutdown`.
$sock_shutdown
+ ;;; The right to invoke `sock_accept`.
+ $sock_accept
)
)
diff --git a/phases/snapshot/witx/wasi_snapshot_preview1.witx b/phases/snapshot/witx/wasi_snapshot_preview1.witx
index efb2c797f..100d852b3 100644
--- a/phases/snapshot/witx/wasi_snapshot_preview1.witx
+++ b/phases/snapshot/witx/wasi_snapshot_preview1.witx
@@ -473,6 +473,17 @@
(result $error (expected (error $errno)))
)
+ ;;; Accept a new incoming connection.
+ ;;; Note: This is similar to `accept` in POSIX.
+ (@interface func (export "sock_accept")
+ ;;; The listening socket.
+ (param $fd $fd)
+ ;;; The desired values of the file descriptor flags.
+ (param $flags $fdflags)
+ ;;; New socket connection
+ (result $error (expected $fd (error $errno)))
+ )
+
;;; Receive a message from a socket.
;;; Note: This is similar to `recv` in POSIX, though it also supports reading
;;; the data into multiple buffers in the manner of `readv`.