sys_socket_bind

Function sys_socket_bind 

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

System call: Bind socket to a path

Binds a socket to a named path in the socket namespace. This allows other processes to connect to this socket by name.

§Arguments (via trapframe)

  • a0: Socket handle ID
  • a1: Pointer to path string (null-terminated)
  • a2: Length of path string (excluding null terminator)

§Returns

0 on success, usize::MAX (-1) on error

§Errors

Returns usize::MAX (-1) if:

  • Invalid handle ID
  • Invalid path pointer or length
  • Path already in use
  • Socket already bound