Open System Services System Calls Reference Manual (G06.28+, H06.05+)
spt_recvx(2) OSS System Calls Reference Manual
The alias to link recv() to spt_recvx() 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
When data is available, a call to the select() function indicates that the file descriptor for the
socket is ready for reading.
Calling the spt_recvx() function with a flags parameter of 0 (zero) is identical to calling the
spt_readx() function.
RETURN VALUES
Upon successful completion, the spt_recvx() function returns the length of the received message
in bytes. If no data is available and the peer socket has performed an orderly shutdown, then 0
(zero) is returned.
If the spt_recvx() 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_recvx() function sets errno to the corresponding value:
[EBADF] The socket parameter is not a valid file descriptor.
[ECONNRESET]
One of the following conditions occurred:
— The transport-provider process for this socket is no longer avail-
able.
— 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] The MSG_OOB value is specified in the flags parameter and no out-of-
band data is available.
[EIO] An input or output error occurred.
[ENOBUFS] Not enough buffer space was available to complete the call. A retry at a
later time might succeed.
[ENOMEM] Required memory resources were not available. A retry at a later time
might succeed.
[ENOTCONN] A receive operation was attempted on a connection-oriented socket that
is not connected.
7−280 Hewlett-Packard Company 527186-007