RWF_NOAPPEND
RWF_NOAPPEND is a Linux pwritev2 flag that suppresses O_APPEND placement for one write operation.
Documented since Linux 6.9, it overrides append placement for the call, not the shared file-status flag. A nonnegative offset selects the position; offset -1 still uses and updates the shared current offset. [1] [2] [3]
In v6.17, kiocb_set_rw_flags returns EPERM when suppressing append would violate an append-only inode, and EINVAL for simultaneous append/noappend flags. It is not a bypass of append-only inode protection. [2]
A zero-total-length write can finish before flag validation. EOPNOTSUPP can mean an unsupported flag or write path, not only an old kernel. Test a nonempty disposable-file operation and inspect placement and errors. [3]
Relations
- related
- RWF_APPEND, O_APPEND, pwrite, File offset, Open file description, Short write, writev, fsync
Advantages
- Keeps per-call positioning separate from later writes through the same open file description.
Limitations
- Availability must be checked for the actual kernel and target, not inferred from a successful empty write. [3]
- Does not replace synchronization, short-write handling or protection against overlapping writers. [1]
Citations
- Linux man-pages: readv(2), pwritev2 per-call flags and offset semantics
- Linux v6.17: kiocb_set_rw_flags validation and per-operation append state
- Linux v6.17: pwritev2 dispatch, current offsets and zero-length write handling