fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usize
Write multiple buffers to a file descriptor, with a position offset. Retries when interrupted by a signal. Returns the number of bytes written. If nonzero bytes were supplied, this will be nonzero.
Note that a successful write() may transfer fewer than count bytes. Such partial writes can occur for various reasons; for example, because there was insufficient space on the disk device to write all of the requested bytes, or because a blocked write() to a socket, pipe, or similar was interrupted by a signal handler after it had transferred some, but before it had transferred all of the requested bytes. In the event of a partial write, the caller can make another write() call to transfer the remaining bytes. The subsequent call will either transfer further bytes or may result in an error (e.g., if the disk is now full).
If fd
is opened in non blocking mode, the function will return error.WouldBlock when EAGAIN is received.
The following systems do not have this syscall, and will return partial writes if more than one vector is provided:
- Darwin
- Windows
If iov.len
is larger than IOV_MAX
, a partial write will occur.