pread · shipping · also pread(), positional read

pread

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.

Related Observatory article: pread on hesela.com

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. [1]

For 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. [2]

Explicit 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.

Relations

related
File offset, Open file description, File descriptor, Short read, pwrite, Linux file sealing

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.

Citations

  1. Linux man-pages 6.19: pread(2), positional access and partial transfers (accessed 2026-11-02)
  2. Linux man-pages 6.19: read(2), return counts and end of file (accessed 2026-11-02)

Further reading

  1. Hesela: sealed bytes, shared cursor (accessed 2026-11-02)
Sources & caveats
  • Source review of Linux man-pages 6.19; reader continuation and source-version checks are application-design implications.

JSON: /data/terms/pread.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. pread. Hesela. 2026-11-02. https://hesela.dev/terms/pread/