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

[Doc] Cherry-pick ephemeral WASI sock API from snapshot-01.

上级 87aaec98
此差异已折叠。
;; 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).
;;
;; This is a `witx` file. See [here](https://github.com/WebAssembly/WASI/tree/master/docs/witx.md)
;; for an explanation of what that means.
(use "typenames.witx")
(module $wasi_ephemeral_sock
;;; Linear memory to be accessed by WASI functions that need it.
(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`.
(@interface func (export "recv")
(param $fd $fd)
;;; List of scatter/gather vectors to which to store data.
(param $ri_data $iovec_array)
;;; Message flags.
(param $ri_flags $riflags)
(result $error $errno)
;;; Number of bytes stored in ri_data.
(result $ro_datalen $size)
;;; Message flags.
(result $ro_flags $roflags)
)
;;; 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`.
(@interface func (export "send")
(param $fd $fd)
;;; List of scatter/gather vectors to which to retrieve data
(param $si_data $ciovec_array)
;;; Message flags.
(param $si_flags $siflags)
(result $error $errno)
;;; Number of bytes transmitted.
(result $so_datalen $size)
)
;;; Shut down socket send and receive channels.
;;; Note: This is similar to `shutdown` in POSIX.
(@interface func (export "shutdown")
(param $fd $fd)
;;; Which channels on the socket to shut down.
(param $how $sdflags)
(result $error $errno)
)
)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册