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

System Functions (s and S) spt_readvz(2)
the prior file operation is complete.
For C applications, a macro to map readv() to spt_readvz() is available when you use the
#define SPT_THREAD_AWARE_XNONBLOCK 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_readvz() is available when you use the
#define SPT_THREAD_AWARE_PRAGMA_XNONBLOCK preprocessor directive before
including spthread.h or when you use an equivalent compiler command option to compile the
application.
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 fol-
lowing 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).
RETURN VALUES
Upon successful completion, the spt_readvz() 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 the read otherwise fails, the value -1 is returned, errno is set to indicate the error, and the con-
tents of the buffers are indeterminate.
ERRORS
If any of these conditions occurs, the spt_readvz() 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.
[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 memeber of the iovec structure points to a location outside of the
allocated address space of the process.
527186-023 Hewlett-Packard Company 7345