{
  "slug": "rwf-nowait",
  "term": "RWF_NOWAIT",
  "aliases": [
    "preadv2 NOWAIT"
  ],
  "definition": "RWF_NOWAIT is a per-operation Linux I/O flag requesting that supported operations avoid waiting for unavailable data or contended resources.",
  "note": "With preadv2 since Linux 4.14, this flag can return a short positive byte count; no progress because waiting would be needed yields -1 with errno EAGAIN. Linux 5.9 and 5.10 have a documented premature-zero-return bug. [readv]\n\nIn Linux v6.17, missing FMODE_NOWAIT support yields EOPNOTSUPP. The generic buffered-read path distinguishes IOCB_NOWAIT from IOCB_NOIO and can initiate readahead before returning EAGAIN. Thus EAGAIN neither identifies a cache miss uniquely nor proves that no storage I/O was started. [nowait-support] [filemap]\n\nOther APIs report completion differently: io_submit uses -EAGAIN in the event's res field for a NOWAIT operation that would block. [io-submit]",
  "advantages": [],
  "limitations": [
    {
      "text": "A caller must handle partial progress and choose a retry or fallback policy rather than treating every nonnegative return as a complete read.",
      "citationIds": [
        "readv"
      ]
    }
  ],
  "related": [
    "buffered-io",
    "page-cache",
    "direct-io",
    "posix-fadv-willneed",
    "readahead",
    "io-uring"
  ],
  "citations": [
    {
      "id": "readv",
      "title": "Linux man-pages 6.19: readv(2), RWF_NOWAIT and return-value caveats",
      "url": "https://man7.org/linux/man-pages/man2/readv.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "nowait-support",
      "title": "Linux v6.17: kiocb_set_rw_flags and FMODE_NOWAIT",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.17/include/linux/fs.h",
      "accessed": "2026-10-17"
    },
    {
      "id": "filemap",
      "title": "Linux v6.17: filemap_get_pages and filemap_readahead",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.17/mm/filemap.c",
      "accessed": "2026-10-17"
    },
    {
      "id": "io-submit",
      "title": "Linux man-pages 6.19: io_submit(2), aio_rw_flags and completion results",
      "url": "https://man7.org/linux/man-pages/man2/io_submit.2.html",
      "accessed": "2026-10-17"
    }
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-17",
  "provenance": [
    "The detailed buffered-path description is pinned to Linux v6.17; it is not a hard wall-clock latency guarantee for every filesystem or environment."
  ]
}
