1.1.24.10 recv
C
ssize_t recv(int fd, void *buf, size_t len, int flags)
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. |
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. |