提交 28660790 编写于 作者: Y Yi Huang 提交者: hydai

[Doc] Fix socket API to be consistent with others.

上级 07127569
;; 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
)
......
;; 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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册