pub fn sys_socket_recvfrom(tf: &mut Trapframe) -> usizeExpand description
System call: Receive datagram with sender address
Receives a datagram from a socket and returns the sender’s address. Used for UDP and Local datagram sockets.
§Arguments (via trapframe)
a0: Socket handle IDa1: Pointer to buffer for receiving dataa2: Buffer lengtha3: Pointer to SocketAddress structure for storing sender address (can be null)
§Returns
Number of bytes received on success, usize::MAX (-1) on error
§Errors
Returns usize::MAX (-1) if:
- Invalid handle ID
- Invalid buffer pointer
- Socket error