diff --git a/doc/witx/typenames.witx b/doc/witx/typenames.witx index d7a272a784679ccd4a5c6c952293c9e49f506b99..80a55e63b49884c932330de5f7c9c583184870ec 100644 --- a/doc/witx/typenames.witx +++ b/doc/witx/typenames.witx @@ -1,7 +1,8 @@ ;; Type names used by low-level WASI interfaces. ;; -;; Some content here is derived from [CloudABI](https://github.com/NuxiNL/cloudabi) -;; and [WASI ephemeral phases](https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/ephemeral). +;; Some content here is derived from [CloudABI](https://github.com/NuxiNL/cloudabi), +;; [WASI ephemeral phases](https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/ephemeral), +;; and [WASI PR#312](https://github.com/WebAssembly/WASI/pull/312). ;; ;; This is a `witx` file. See [here](https://github.com/WebAssembly/WASI/tree/master/docs/witx.md) ;; for an explanation of what that means. @@ -277,6 +278,10 @@ ;;; If `rights::fd_read` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_read`. ;;; If `rights::fd_write` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_write`. $poll_fd_readwrite + ;;; The right to invoke `sock_recv`. + $sock_recv + ;;; The right to invoke `sock_send`. + $sock_send ;;; The right to invoke `sock_shutdown`. $sock_shutdown ) diff --git a/doc/witx/wasi_ephemeral_sock.witx b/doc/witx/wasi_ephemeral_sock.witx index 453e60762b23d51368dc10206997fd056c2dac24..97b5e20812e17128c758f9a69ad651c1726e8390 100644 --- a/doc/witx/wasi_ephemeral_sock.witx +++ b/doc/witx/wasi_ephemeral_sock.witx @@ -1,7 +1,8 @@ ;; WASI Sockets. ;; -;; Some content here is derived from [CloudABI](https://github.com/NuxiNL/cloudabi) -;; and [WASI ephemeral phases](https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/ephemeral). +;; Some content here is derived from [CloudABI](https://github.com/NuxiNL/cloudabi), +;; [WASI ephemeral phases](https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/ephemeral), +;; and [WASI PR#312](https://github.com/WebAssembly/WASI/pull/312). ;; ;; This is a `witx` file. See [here](https://github.com/WebAssembly/WASI/tree/master/docs/witx.md) ;; for an explanation of what that means. @@ -13,33 +14,31 @@ (import "memory" (memory)) ;;; 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`. + ;;; Note: This is similar to `recv` in POSIX. (@interface func (export "recv") (param $fd $fd) - ;;; List of scatter/gather vectors to which to store data. - (param $ri_data $iovec_array) + ;;; The pointer to and length of the buffer for data received. + (param $buf (@witx pointer u8)) + (param $buf_len $size) ;;; Message flags. - (param $ri_flags $riflags) + (param $flags $riflags) (result $error $errno) - ;;; Number of bytes stored in ri_data. - (result $ro_datalen $size) - ;;; Message flags. - (result $ro_flags $roflags) + ;;; Number of bytes used in the buffer. + (result $bufused $size) ) - ;;; Send a message on a socket. - ;;; Note: This is similar to `send` in POSIX, though it also supports writing - ;;; the data from multiple buffers in the manner of `writev`. + ;;; Send a message from a socket. + ;;; Note: This is similar to `send` in POSIX. (@interface func (export "send") (param $fd $fd) - ;;; List of scatter/gather vectors to which to retrieve data - (param $si_data $ciovec_array) + ;;; The pointer to and length of the buffer for data. + (param $buf (@witx pointer u8)) + (param $buf_len $size) ;;; Message flags. - (param $si_flags $siflags) + (param $_flags $siflags) (result $error $errno) ;;; Number of bytes transmitted. - (result $so_datalen $size) + (result $bufused $size) ) ;;; Shut down socket send and receive channels.