Module Uring.Rw_flags

Per-operation flags for read/write requests, as for preadv2(2)/pwritev2(2).

These modify the behaviour of a single submission, unlike the O_* flags fixed at open time. The kernel rejects flags that it does not recognise, or that the target file or filesystem does not support, by failing the operation with EOPNOTSUPP; callers using the newer flags should be prepared to fall back.

include FLAGS
type t = private int

A set of flags.

val empty : t
val of_int : int -> t

of_int i is the flags whose bits are those set in i.

val to_int : t -> int

to_int t is the integer with the bits of the flags t set.

val (+) : t -> t -> t

a + b is the union of the sets.

val mem : t -> t -> bool

mem x flags is true iff x is a subset of flags.

val (=) : t -> t -> bool

a = b is true iff a and b are the same set of flags.

val hipri : t

RWF_HIPRI: high-priority request; poll for completion where possible. Only meaningful with O_DIRECT on block devices configured for polled I/O.

val dsync : t

RWF_DSYNC: per-write O_DSYNC. The write and its data-integrity sync complete as a single operation, removing the need for a separate fdatasync afterwards.

val sync : t

RWF_SYNC: per-write O_SYNC; as dsync but also synchronising file metadata.

val nowait : t

RWF_NOWAIT: fail with EAGAIN rather than waiting for data that is not immediately available. This disables the kernel's retrymechanism, so the completion may fail with EAGAIN.

val append : t

RWF_APPEND: per-write O_APPEND.

val noappend : t

RWF_NOAPPEND: write at the given offset even if the file was opened with O_APPEND. Since Linux 6.9.

val atomic : t

RWF_ATOMIC: the write is committed untorn — either fully written or not at all. Requires filesystem and device support; see the stx_atomic_write_* fields of statx. Since Linux 6.11.

val dontcache : t

RWF_DONTCACHE: buffered I/O that drops the affected pages from the page cache once the operation completes, avoiding cache pollution in streaming workloads. Requires filesystem support. Since Linux 6.14.