readv
readv reads data from a file descriptor into an ordered array of memory buffers.
Buffers are filled in array order: each earlier buffer is filled before the next receives data, and the returned count is the total bytes transferred across the vector. A successful short read can therefore stop inside a buffer; it does not make the remaining capacity valid input. Python's os.readv exposes this ordered-buffer contract [3]. On a seekable file, readv uses the open file description's current file offset and advances it by the bytes actually read [2]. This differs from preadv's explicit-position contract. The vector supplies memory destinations, not separate file offsets [1].
Relations
- related
- preadv, pread, Short read, File offset, Open file description, writev
Advantages
- Places input into multiple caller-provided buffers in one call.
Limitations
- A nonnegative return count does not guarantee that every buffer was filled.
- Buffer count is bounded by the implementation's IOV_MAX limit.
Citations
- Linux man-pages: readv(2), DESCRIPTION, RETURN VALUE and NOTES
- Linux man-pages: read(2), DESCRIPTION and RETURN VALUE
- Python documentation: os.readv
Sources & caveats
- Primary API documentation reviewed 2026-11-02; no native measurement, throughput test or storage-failure estimate.