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

ParametersDescription
fdSocket file descriptor.
bufPointer to buffer to receive data.
lenLength of data to receive.
flagsOption for reception, currently ignored.
addrPointer to a structure to receive the peer address.
alenPointer 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

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.