sys_socket_sendto

Function sys_socket_sendto 

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

System call: Send datagram to specified address

Sends a datagram to a specific address. Used for UDP and Local datagram sockets.

§Arguments (via trapframe)

  • a0: Socket handle ID
  • a1: Pointer to data buffer
  • a2: Data length
  • a3: Pointer to SocketAddress structure (destination address)

§Returns

Number of bytes sent on success, usize::MAX (-1) on error

§Errors

Returns usize::MAX (-1) if:

  • Invalid handle ID
  • Invalid buffer pointer
  • Invalid address
  • Socket error