Function wasmer_wasix::syscalls::wasix::sock_open::sock_open

source ·
pub fn sock_open<M: MemorySize>(
    ctx: FunctionEnvMut<'_, WasiEnv>,
    af: Addressfamily,
    ty: Socktype,
    pt: SockProto,
    ro_sock: WasmPtr<Fd, M>,
) -> Result<Errno, WasiError>
Expand description

§sock_open()

Create an endpoint for communication.

creates an endpoint for communication and returns a file descriptor tor that refers to that endpoint. The file descriptor returned by a successful call will be the lowest-numbered file descriptor not currently open for the process.

Note: This is similar to socket in POSIX using PF_INET

§Parameters

  • af - Address family
  • socktype - Socket type, either datagram or stream
  • sock_proto - Socket protocol

§Return

The file descriptor of the socket that has been opened.