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

ParametersDescription
fdSocket file descriptor.
bufPointer to buffer to receive data.
lenLength of data to receive.
flagsOption 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

errnoDescription
EBADFThe argument fd is not a valid file descriptor.
EFAULTSystem fault.
ENOTSOCKThe file descriptor fd does not refer to a socket.
EWOULDBLOCKThe socket is marked nonblocking and the receive operation would block.