.TH READV 3 "January 6, 2010" .UC 4 .SH NAME readv, writev \- vector-based IO .SH SYNOPSIS .nf .ft B #include ssize_t readv(int \fIfildes\fP, const struct iovec *\fIiov\fP, int \fIiovcnt\fP); ssize_t writev(int \fIfildes\fP, const struct iovec *\fIiov\fP, int \fIiovcnt\fP); .fi .SH DESCRIPTION The \fBreadv\fP and \fBwritev\fP functions allow one to use multiple buffers when reading from or writing to files. The \fIfildes\fP parameter specifies the file descriptor as with the \fBread\fP and \fBwrite\fP functions. \fIiov\fP 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 \fIiovcnt\fP. At most IOV_MAX buffers may be specified and their total size may not exceed SSIZE_MAX (both constants are defined in limits.h). .SH "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. .SH "SEE ALSO" read(2), write(2)