ssize_t pread(int fd, void *buffer, size_t count, off_t offset); ssize_t pwrite(int fd, void *buffer, size_t count, off_t offset);
These syscalls do the same as read
and write
respectively, but
instead of using the description’s saved location for data access, they use the
passed offset
, and do not update it at the end of the operation.
fd
must point to a seekable file.
These syscalls are made for use in multithreaded applications, as having more than one thread updating file locations for a shared file description can lead to sudden catharsis.
These syscalls return the same values and errno as the non-p variants. read/write.