sys_socketpair

Function sys_socketpair 

Source
pub fn sys_socketpair(
    abi: &mut LinuxRiscv64Abi,
    trapframe: &mut Trapframe,
) -> usize
Expand description

Linux sys_socketpair implementation

Create a pair of connected sockets. This is primarily used for AF_UNIX sockets to create a bidirectional communication channel between processes.

Arguments:

  • abi: LinuxRiscv64Abi context
  • trapframe: Trapframe containing syscall arguments
    • arg0: domain (address family, must be AF_UNIX)
    • arg1: type (socket type, e.g., SOCK_STREAM)
    • arg2: protocol (usually 0)
    • arg3: sv (pointer to int[2] to receive the file descriptors)

Returns:

  • 0 on success
  • negative errno on error