1.1.24.11 recvfrom
C
ssize_t recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *alen)Description
Receive a message from a socket.
Parameters
| Parameters | Description |
|---|---|
| fd | Socket file descriptor. |
| buf | Pointer to buffer to receive data. |
| len | Length of data to receive. |
| flags | Option for reception, currently ignored. |
| addr | Pointer to a structure to receive the peer address. |
| alen | Pointer to length of address structure. |
Returns
The number of bytes received or -1 for error, see errno.
If the return value is 0, the socket has performed an orderly shutdown.
Remarks
| errno | Description |
|---|---|
| EBADF | The argument fd is not a valid file descriptor. |
| EFAULT | System fault. |
| ENOTSOCK | The file descriptor fd does not refer to a socket. |
| EWOULDBLOCK | The socket is marked nonblocking and the receive operation would block. |
