Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (r) recvfrom(2)
NAME
recvfrom - Receives a message from a socket
LIBRARY
G-series native OSS processes: system library
H-series and J-series OSS processes: implicit libraries
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
SYNOPSIS
#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/socket.h>
ssize_t recvfrom(
int socket,
void *buffer,
size_t length,
int flags,
struct sockaddr *address,
socklen_t *address_len);
PARAMETERS
socket Specifies the file descriptor of the socket.
buffer Points to the buffer where the message should be written.
length Specifies the length in bytes of the buffer pointed to by the buffer parameter.
flags Is a value that controls message reception. The value of the flags parameter is
formed by bitwise ORing zero or more of the following values:
MSG_OOB Requests out-of-band data.
MSG_PEEK Peeks at an incoming message. The data is treated as unread and
the next call to the recvfrom() function (or similar function)
will still return this data.
address Specifies either a null pointer or a pointer to a sockaddr structure in which the
sending address is to be stored. The length and format of the address depend on
the address family of the socket.
For AF_INET sockets, a pointer to the address structure sockaddr_in must be
cast as a struct sockaddr.ForAF_INET6 sockets, a pointer to the address
structure sockaddr_in6 must be cast as a struct sockaddr.ForAF_UNIX sock-
ets, a pointer to the address structure sockaddr_un must be cast as a struct
sockaddr.
address_len Points to a socklen_t data item, which, on input, specifies the length of the
sockaddr structure that is pointed to by the address parameter, and, on return,
specifies the length of the address stored.
DESCRIPTION
The recvfrom() function receives messages from a connection-oriented or connectionless
socket. recvfrom() is normally used with connectionless sockets because it includes parameters
that permit a calling program to retrieve the source address of received data.
527186-023 Hewlett-Packard Company 627