Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) spt_recvfromx(2)
NAME
spt_recvfromx - Receives a message from a socket (thread-aware version)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series and J series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <sys/socket.h>]
#include <spthread.h>
ssize_t spt_recvfromx(
int socket,
void *buffer,
size_t length,
int flags,
struct sockaddr *address,
size_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 spt_recvfromx() function (or similar func-
tion) 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 size_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 spt_recvfromx() function is a thread-aware version of the recvfrom() function.
The spt_recvfromx() function receives messages from a connection-oriented or connectionless
socket. spt_recvfromx() is normally used with connectionless sockets because it includes
parameters that permit a calling program to retrieve the source address of received data.
For message-based sockets (sockets of type SOCK_DGRAM), the entire message must be read
in one call. If a message is too long to fit in the supplied buffer and MSG_PEEK is not set in the
flags parameter, the excess bytes are discarded.
527186-023 Hewlett-Packard Company 7−369