Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The madvise() system call is used is to improve the performance of an application by informing the kernel about the calling process’s likely usage of the pages in the range starting at addr and continuing for length bytes. The kernel may use this information to improve the efficiency of I/O performed on the file mapping that underlies the pages. (See Section 49.4 for a discussion of file mappings.) On Linux, madvise() has been available since kernel 2.4.
#define _BSD_SOURCE #include <sys/mman.h> int madvise(void *addr, size_t length, int advice);