writev
writev is a vectored I/O operation that writes an ordered array of buffers to a file descriptor and reports the total number of bytes transferred.
Buffers are consumed in array order; the return value counts bytes, not completed buffers. [2] Hesela's three controlled Linux child processes submitted AB and CDEF with file-size limits of 2, 3 and 6 bytes. The middle case returned 3 and read back ABC, leaving DEF rather than the entire second buffer. The two incomplete cases then reported EFBIG on retry. These are deliberate limits, not measured device failures. [3] A single vectored call is distinct from several write calls; neither its interface nor a full count alone establishes post-crash persistence. [1]
Relations
- related
- short-write, pwrite, o-append, torn-write, fsync
Advantages
- Accepts separate buffers without requiring the application to concatenate them into one byte string.
Limitations
- A successful return can stop inside an individual buffer; retries must advance by bytes.
- No performance benchmark, concurrency test, direct I/O or power interruption was performed in the Hesela observation.
Citations
- Linux man-pages 6.19: readv(2), writev ordering and return-value semantics
- Python 3.12 documentation: os.writev
- Hesela: controlled vectored-write observation with environment and source SHA-256