Open System Services System Calls Reference Manual (G06.28+, H06.05+)
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 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 param-
eter.
flags Is a value that controls message reception. The value of the flags param-
eter 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() func-
tion (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.
For AF_UNIX sockets, 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 the 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.
527186-007 Hewlett-Packard Company 7−271