@item RWF_NOAPPEND
This flag allows an offset to be honored, even if the file was opened with
@code{O_APPEND} flag.
+
+@item RWF_ATOMIC
+Indicate that the write is to be issued with torn-write prevention. The
+input buffer should follow some contraints: the total length should be
+power-of-2 in size and also sizes between @code{atomic_write_unit_min}
+and @code{atomic_write_unit_max}, the @code{struct iovec} count should be
+up to @code{atomic_write_segments_max}, and the offset should be
+naturally-aligned with regard to total write length.
+
+The @code{atomic_*} values can be obtained with @code{statx} along with
+@code{STATX_WRITE_ATOMIC} flag.
+
+This is a Linux-specific extension.
@end vtable
When the source file is compiled with @code{_FILE_OFFSET_BITS == 64} the
#ifndef RWF_NOAPPEND
# define RWF_NOAPPEND 0
#endif
+#ifndef RWF_ATOMIC
+# define RWF_ATOMIC 0
+#endif
#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT \
- | RWF_APPEND | RWF_NOAPPEND)
+ | RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC)
/* Generic uio_lim.h does not define IOV_MAX. */
#ifndef IOV_MAX
#define RWF_NOWAIT 0x00000008 /* per-IO nonblocking mode. */
#define RWF_APPEND 0x00000010 /* per-IO O_APPEND. */
#define RWF_NOAPPEND 0x00000020 /* per-IO negation of O_APPEND */
+#define RWF_ATOMIC 0x00000040 /* Write is to be issued with torn-write
+ prevention. */
__END_DECLS