writev
Writev is a system call in POSIX-compatible operating systems that performs vectorized output by writing data from multiple user-space buffers described by an array of iovec structures to a file descriptor in a single call. The function signature is ssize_t writev(int fd, const struct iovec *iov, int iovcnt).
Each element of the iovec describes a memory region with a base pointer and a length: struct
Return value and errors: On success, writev returns the number of bytes written, which may be less
Semantics: writev is designed to minimize system calls when writing data that is already split across multiple
Portability: writev is defined by POSIX.1-2001 and is implemented on Linux, BSDs, macOS, and other Unix-like systems.
Related: readv (the counterpart for reading into multiple buffers) and the iovec structure.