READV(3)

NAME
readv, writev - vector-based IO

SYNOPSIS
#include <sys/uio.h>
ssize_t readv(int fildes, const struct iovec *iov, int iovcnt);
ssize_t writev(int fildes, const struct iovec *iov, int iovcnt);

DESCRIPTION
The readv and writev functions allow one to use multiple buffers when reading from or writing to files. The fildes parameter specifies the file descriptor as with the read and write functions. iov specifies an array of buffers to be read into or written from. For each element of this array, the iov_base member specifies the address of the buffer and iov_len specifies its size in bytes. The number of buffers is specified by iovcnt. At most IOV_MAX buffers may be specified and their total size may not exceed SSIZE_MAX (both constants are defined in limits.h).

RETURN VALUE
In case of success, the total number of bytes read or written is returned. Zero may be returned if no buffers were specified or each buffer has size zero. In the case of writev, a return value zero may also indicate an end of file condition. If the functions fail, -1 is returned.

SEE ALSO
read(2), write(2)