Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (r) recvfrom(2)
If no messages are available at the socket and the sockets le descriptor is blocking
(O_NONBLOCK is not set), the recvfrom() function blocks until a message arrives. If no mes-
sages are available at the socket and the sockets le descriptor is marked nonblocking
(O_NONBLOCK is set), the recvfrom() function fails and sets errno to [EWOULDBLOCK].
If the address parameter is not a null pointer, the source address of the received message is stored
in the sockaddr structure pointed to by the address parameter, and the length of this address is
stored in the object pointed to by the address_len parameter.
If the actual length of the address is greater than the length of the supplied sockaddr structure,
the address is truncated when stored.
NOTES
When data is available, a call to the select() function indicates that the le descriptor for the
socket is ready for reading.
RETURN VALUES
Upon successful completion, the recvfrom() function returns the length of the received message
in bytes. If no data is available and the peer socket has performed an orderly shutdown, then 0
(zero) is returned.
If the recvfrom() function call fails, the value -1 is returned and errno is set to indicate the
error.
ERRORS
If any of the following conditions occurs, the recvfrom() function sets errno to the correspond-
ing value:
[EBADF] The socket parameter is not a valid le descriptor.
[ECONNRESET]
One of the following conditions occurred:
The transport-provider process for this socket is no longer available.
The TCP/IP subsystem for this socket is no longer available.
The connection was forcibly closed by the peer socket.
The socket can only be closed.
[EFAULT] A user-supplied memory buffer cannot be accessed or written.
[EINTR] A signal interrupted the function before any data was available.
[EINVAL] The MSG_OOB value is specied in the ags parameter and no out-of-band
data is available.
[EIO] An input or output error occurred.
[ENOBUFS] There was not enough buffer space available to complete the call. A retry at a
later time may succeed.
[ENOMEM] Required memory resources were not available. A retry at a later time may
succeed.
[ENOTCONN] A receive operation was attempted on a connection-oriented socket that is not
connected.
527186-003 Hewlett-Packard Company 617