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

System Functions (s and S) spt_readvz(2)
NAME
spt_readvz - Reads from a file into scattered buffers (thread-aware version)
LIBRARY
H-series and J series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <sys/types.h>
#include <sys/uio.h>
#include <spthread.h>
int spt_readvz(
int filedes,
struct iovec *iov,
int iov_count);
PARAMETERS
filedes Specifies an open file descriptor obtained from a successful call to the
spt_acceptx(), creat(), creat64(), dup(), spt_dup2x(), spt_fcntlz(), open(),
open64(), pipe(), socket(),orsocketpair() function.
iov Points to an iovec structure that identifies the buffers into which the data is to be
placed.
iov_count Specifies the number of entries in the iovec structure pointed to by the iov
parameter.
DESCRIPTION
The spt_readvz() function is a thread-aware version of the readv() function.
The spt_readvz() function attempts to read data from the file associated with the filedes parame-
ter into a set of buffers. The spt_readvz() function performs the same action as the spt_readz()
function, but it scatters the input data into the buffers specified by the array of iovec structure
entries pointed to by the iov parameter.
On regular files and devices capable of seeking, the spt_readvz() function starts at a position in
the file given by the file pointer associated with the filedes parameter. Upon return from the
spt_readvz() function, the file pointer is incremented by the number of bytes actually read.
Devices that are incapable of seeking always read from the current position. For such devices,
the value of the file pointer after a call to the spt_readvz() function is always 0 (zero).
Upon successful completion, the spt_readvz() function returns the number of bytes actually read
and placed in the buffers.
No data transfer occurs past the current end-of-file (EOF). If the starting position is at or after the
end-of-file, 0 (zero) is returned.
If an spt_writez() or spt_writevz() call contains so much data that the file system needs to
resize a pipe or FIFO buffer, a read from that pipe or FIFO file can return up to 52 kilobytes of
data, regardless of the size of PIPE_BUF. If the buffer cannot be resized for the write operation,
a subsequent read from the pipe or FIFO file does not return more than 8192 bytes per call,
regardless of the setting of O_NONBLOCK.
When attempting to read from an empty pipe (or FIFO file):
If no process has the pipe open for writing, the spt_readvz() function returns the value 0
(zero) to indicate EOF.
If some process has the pipe open for writing:
527186-023 Hewlett-Packard Company 7343