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

spt_recvmsgx(2) OSS System Calls Reference Manual
of the msghdr structure.
For stream-based sockets (sockets of type SOCK_STREAM), message boundaries are ignored.
For such sockets, data is returned as soon as it becomes available; no data is discarded.
If no messages are available at the socket and the socket’s file descriptor is blocking
(O_NONBLOCK is not set), the spt_recvmsgx() function blocks until a message arrives. If no
messages are available at the socket and the socket’s file descriptor is marked nonblocking
(O_NONBLOCK is set), the spt_msgx() function fails and sets errno to [EWOULDBLOCK].
In the msghdr structure, the msg_name and msg_namelen members specify the source address
if the socket is unconnected. If the socket is connected, the msg_name and msg_namelen
members are ignored. The msg_name member can be a null pointer if no names are desired or
required. The msg_iov and msg_iovlen members describe the scatter and gather locations.
Upon successful completion of the spt_recvmsgx() call, the value of the msg_flags member of
the msghdr structure is the bitwise OR of zero or more of the following values:
MSG_CTRUNC
Control data was truncated.
MSG_OOB Out-of-band data was received.
MSG_TRUNC
Normal data was truncated.
In the msghdr structure, the msg_control and msg_controllen members specify the ancillary
data buffer that only sockets in the AF_UNIX domain can use to receive file descriptors passed
from another process on the same node. The msg_control member can be a null pointer if ancil-
lary data is not desired or required. If the msg_control member is nonnull, on input the
msg_controllen member contains the size of the ancillary data buffer and on output it contains
the size of the received ancillary data. If, on output, the msg_controllen member is nonzero, the
ancillary data buffer contains a cmsghdr structure followed by 1 to 16 file descriptors.
If spt_recvmsgx() is called with an ancillary data buffer and MSG_PEEK is set, the
msg_controllen member is valid, but the ancillary data is not meaningful (no file descriptors are
received). Ancillary data is not discarded but remains available for the next call to
spt_recvmsgx() where MSG_PEEK is set.
If spt_recvmsgx() is called with an ancillary data buffer that is too small to hold the available
file descriptors, MSG_CTRUNC is set, and the excess file descriptors are discarded.
If spt_recvmsgx() is called with an ancillary data buffer and one or more of the received le
descriptors are unusable (perhaps because of a device error), no error is indicated until the file
descriptor is used.
NOTES
The macro to map recvmsg() to spt_recvmsgx() is available in C applications when
SPT_THREAD_AWARE_NONBLOCK has been defined in the following manner before
including spthread.h:
#define SPT_THREAD_AWARE_NONBLOCK
The alias to link recvmsg() to spt_recvmsgx() is available in C++ applications when
SPT_THREAD_AWARE_PRAGMA_NONBLOCK has been defined in the following manner
before including spthread.h:
#define SPT_THREAD_AWARE_PRAGMA_NONBLOCK
To use this function in a threaded application that uses the Standard POSIX Threads library on
systems running J06.10 or later RVUs or H06.21 or later RVUs, you must perform all of the
7374 Hewlett-Packard Company 527186-023