Open System Services System Calls Reference Manual (G06.28+, H06.05+)

System Functions (s and S) spt_readx(2)
NOTES
The macro to map read() to spt_readx() is available in C applications when
SPT_THREAD_AWARE_NONBLOCK
has been dened in the following manner before
including spthread.h:
#dene SPT_THREAD_AWARE_NONBLOCK
The alias to link read() to spt_readx() is available in C++ applications when
SPT_THREAD_AWARE_PRAGMA_NONBLOCK
has been dened in the following manner
before including spthread.h:
#dene SPT_THREAD_AWARE_PRAGMA_NONBLOCK
RETURN VALUES
Upon successful completion, the spt_readx() function returns the number of bytes actually read
and placed into the buffer. The function guarantees to read the number of bytes requested only if
the descriptor references a regular le that has at least that number of bytes left before EOF indi-
cation.
If a regular le does not contain enough bytes to satisfy the read, or if the read otherwise fails,
the value -1 is returned, errno is set to indicate the error, and the contents of the buffer pointed to
by the buffer parameter are indeterminate.
If the le descriptor 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_readx() function sets errno to the corresponding value:
[EAGAIN] The O_NONBLOCK ag is set for the le descriptor, and the process
would be delayed in the read operation.
The O_NONBLOCK ag is set, and no data was available.
[EBADF] The ledes parameter is not a valid le descriptor open for reading.
[ECONNRESET]
One of these 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 le descriptor specied by the ledes parameter can only be closed.
[EFAULT] The buffer parameter points to a location outside of the allocated address
space of the process.
[EFILEBAD] An attempt was made to read from a Guardian EDIT le (a le in /G
with le code 101) with a corrupted internal structure.
[EINTR] An spt_readx() operation was interrupted by a signal before any data
arrived.
527186-007 Hewlett-Packard Company 7265