{
  "slug": "readahead",
  "term": "readahead (Linux syscall)",
  "aliases": [
    "readahead(2)"
  ],
  "definition": "The Linux readahead syscall requests advance loading of a file range into the page cache without advancing the open file description's offset.",
  "note": "Ranges are handled in whole pages and stop at end of file. Success returns zero, not a fetched-byte count; errors return -1 and set errno. Subsequent reads benefit only if data arrives in time and remains cached. [readahead-api]\n\nThe call may block while locating blocks through filesystem metadata, including the documented ext2/ext3/ext4 indirect-block case. Background data reads therefore do not establish a hard nonblocking-call guarantee. [readahead-api]",
  "advantages": [],
  "limitations": [
    {
      "text": "This Linux-specific interface is distinct from the general automatic read-ahead policy triggered by ordinary reads.",
      "citationIds": [
        "readahead-api"
      ]
    }
  ],
  "related": [
    "posix-fadv-willneed",
    "rwf-nowait",
    "page-cache",
    "buffered-io"
  ],
  "citations": [
    {
      "id": "readahead-api",
      "title": "Linux man-pages 6.19: readahead(2), ranges, return values and metadata blocking",
      "url": "https://man7.org/linux/man-pages/man2/readahead.2.html",
      "accessed": "2026-10-17"
    }
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-17"
}
