When used with the descriptor (fd), read () and write () rely on the internal state of fd to know the "current offset" at which read and write occurs. As a result, they are not thread safe.
So that one descriptor can be used by several threads at the same time, pread () and pwrite () are provided. The descriptor and the required offset are indicated with these interfaces, so the "current offset" is not used in the descriptor.
source share