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

spt_readvx(2) OSS System Calls Reference Manual
For C applications, a macro to map readv() to spt_readvx() is available when you use the
#define SPT_THREAD_AWARE_NONBLOCK preprocessor directive before including
spthread.h or when you use an equivalent compiler command option to compile the application.
For C++ applications, an alias to map readv() to spt_readvx() is available when you use the
#define SPT_THREAD_AWARE_PRAGMA_NONBLOCK preprocessor directive before
including spthread.h or when you use an equivalent compiler command option to compile the
application.
RETURN VALUES
Upon successful completion, the spt_readvx() function returns the number of bytes actually read
and placed into the buffers. The function guarantees to read the number of bytes requested only if
the descriptor references a regular file that has at least that number of bytes left before EOF.
If a regular file 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 buffers are indeter-
minate.
If the file 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_readvx() function sets errno to the corresponding
value:
[EAGAIN] One of these conditions occurred:
The O_NONBLOCK flag is set for the file descriptor, and the process
would be delayed in the read operation.
The O_NONBLOCK flag is set for the file descriptor, and no data was
available.
[EALREADY] Operation already in progress. An I/O operation started by a thread-aware func-
tion (such as spt_writez()) is in progress on a regular file and a function that is
process-blocking for regular files (such as read(), spt_read(),orspt_readx())
attempts to begin an I/O operation on the same open file.
[EBADF] The filedes parameter is not a valid file descriptor open for reading.
[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 file descriptor specified by the filedes parameter can only be closed.
[EFAULT] The iov_base member of the iovec structure points to a location outside of the
allocated address space of the process.
[EFILEBAD] An attempt was made to read from a Guardian EDIT file (a file in /G with file
code 101) with a corrupted internal structure.
7340 Hewlett-Packard Company 527186-023