sys_socket_create

Function sys_socket_create 

Source
pub fn sys_socket_create(tf: &mut Trapframe) -> usize
Expand description

System call: Create a new socket

Creates a Scarlet Native local socket for IPC.

§Arguments (via trapframe)

  • a0: Socket domain (SocketDomain)
  • a1: Socket type (SocketType)
  • a2: Socket protocol (SocketProtocol)

§Returns

Handle ID of the newly created socket (> 0), or error code (usize::MAX for -1).

§Errors

Returns usize::MAX (-1) if:

  • Failed to allocate handle
  • Internal error creating socket