fadvise64(2) -- Linux man page
NAMEfadvise64,fadvise64_64 - Give advice about file access
- long fadvise64_64 (int fs, loff_t offset, loff_t len, int advice, int fs, loff_t offset, loff_t len, int advice);
- long sys_fadvise64 (int fs, loff_t offset, loff_t len, int advice, int fs, loff_t offset, loff_t len, int advice);
Allows an application to to tell the kernel how it expects to use a file handle, so that the kernel can choose appropriate read-ahead and caching techniques for access to the corresponding file. This is similar to the POSIX version of the madvise system call, but for file access instead of memory access. The sys_fadvise64() function is obsolete and corresponds to a broken glibc API, sys_fadvise64_64() is the fixed version. The following are the values for the advice parameter:
- No special treatment.
- Expect page references in random order.
- Expect page references in sequential order.
- Expect access in the near future.
- Do not expect access in the near future. Subsequent access of pages in this range will succeed, but will result either in reloading of the memory contents from the underlying mapped file or zero-fill-in-demand pages for mappings without an underlying file.
- Access data only once.
- An invalid file descriptor was specified. to modify the modules.
- An invalid f_mapping of file, len value smaller than 0 or advice value unknown.