Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) spt_recvmsgx(2)
following tasks:
• Include the spthread.h header file in the application.
• Compile the application using the _SPT_MODEL_ feature test macro or equivalent
compiler command option in addition to any other feature test macros in use.
• Link the application to the zsptdll library (/G/system/zdllnnn/zsptdll).
When data is available, a call to the select() function indicates that the file descriptor for the
socket is ready for reading.
RETURN VALUES
Upon successful completion, the spt_recvmsgx() function returns the length of the received
message in bytes. If no data is available and the peer socket has performed an orderly shutdown,
0 (zero) is returned.
If the spt_recvmsgx() function call fails, the value -1 is returned, and errno is set to indicate the
error.
If the socket becomes invalid (is closed by another thread), -1 is returned with an errno value of
[EBADF]. If a signal is received via the pthread_kill() function and is not blocked, ignored, or
handled, -1 is returned with an errno value of [EINTR].
ERRORS
If any of these conditions occur, the spt_recvmsgx() function sets errno to the corresponding
value:
[EBADF] The socket parameter is not a valid file descriptor.
[ECONNRESET]
One of these 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] One of these conditions occurred:
• The MSG_OOB value is specified in the flags parameter, and no out-of-
band data is available.
• The sum of the values specified for the msg_iovlen field of the msghdr
structure is too large for a data item of type ssize_t.
• The socket belongs to the AF_INET or AF_INET6 domain, and the
function call requested msg_control data.
• The socket belongs to the AF_UNIX domain, and the size of
msg_controllen is less than the size of the cmsghdr structure plus one
file descriptor.
527186-023 Hewlett-Packard Company 7−375