term% cat index.txt
READV(2) System Calls Manual READV(2)
readv, writev, preadv, pwritev - scatter/gather read and write
long readv(int fd, IOchunk *io, int nio)
long preadv(int fd, IOchunk *io, int nio, vlong off)
long writev(int fd, IOchunk *io, int nio)
long pwritev(int fd, IOchunk *io, int nio, vlong off)
These functions supplement the standard read and write operations of
read(2) with facilities for scatter/gather I/O. The set of I/O buffers
is collected into an array of IOchunk structures passed as an argument.
Readv reads data from fd and returns the total number of bytes
received. The received data is stored in the successive nio elements
of the IOchunk array, storing io.len bytes at io.addr, the next
io.len at io.addr, and so on. Preadv does the same, but implic‐
itly seeks to I/O offset off by analogy with readv.
Writev and pwritev are the analogous write routines.
These functions set errstr.
The implementations use malloc(2) to build a single buffer for a stan‐
dard call to read or write. They are placeholders for possible future