{
  "slug": "pread",
  "term": "pread",
  "aliases": [
    "pread()",
    "positional read"
  ],
  "definition": "pread attempts to read up to the requested byte count from a seekable file at an explicit offset without changing the open file description's current position.",
  "note": "Unlike a separate seek followed by read, positional reading does not depend on another holder leaving the shared cursor untouched. It still permits a successful short transfer. [pread-api]\n\nFor an exact-length application record, continue at the initial offset plus bytes actually returned, reducing the remaining count accordingly. A positive-count regular-file read returning zero before that range is complete means premature EOF for that contract; a zero-count request is not an EOF test. [read-api]\n\nExplicit positioning does not freeze content. Concurrent writes or truncation can invalidate an application's expected version even when its byte count is complete. This is a protocol-design limitation, not a storage-failure measurement.",
  "status": "shipping",
  "advantages": [
    "Supports independent read positions on one shared open file description."
  ],
  "limitations": [
    "Requires a seekable object; pipes and sockets do not provide this operation.",
    "Range completion alone establishes neither a snapshot nor data authenticity."
  ],
  "related": [
    "file-offset",
    "open-file-description",
    "file-descriptor",
    "short-read",
    "pwrite",
    "file-sealing"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-02",
  "citations": [
    {
      "id": "pread-api",
      "title": "Linux man-pages 6.19: pread(2), positional access and partial transfers",
      "url": "https://man7.org/linux/man-pages/man2/pread.2.html",
      "accessed": "2026-11-02"
    },
    {
      "id": "read-api",
      "title": "Linux man-pages 6.19: read(2), return counts and end of file",
      "url": "https://man7.org/linux/man-pages/man2/read.2.html",
      "accessed": "2026-11-02"
    },
    {
      "id": "hesela-handoff",
      "title": "Hesela: sealed bytes, shared cursor",
      "url": "https://hesela.com/analyses/mmap-visibility-size-durability/#sealed-handoff",
      "accessed": "2026-11-02"
    }
  ],
  "provenance": [
    "Source review of Linux man-pages 6.19; reader continuation and source-version checks are application-design implications."
  ]
}
