posix_fadvise() hints at the application's access pattern to the file and range given by the file descriptor,
fd, and
offset and
size. If
size is zero, it means to the end of file.
hint should be one of the followings.
POSIX_FADV_NORMAL
No hint. (default)
POSIX_FADV_RANDOM
Random access.
POSIX_FADV_SEQUENTIAL
Sequential access. (from lower offset to higher offset.)
POSIX_FADV_WILLNEED
Will be accessed.
POSIX_FADV_DONTNEED
Will not be accessed.
POSIX_FADV_NOREUSE
Will be accessed just once.
Calling
posix_fadvise() doesn't alter the semantics of the operations, it is only a matter of performance.