Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

50. Virtual Memory Operations > Advising Future Memory Usage Patterns: madvise(...

Advising Future Memory Usage Patterns: madvise()

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 File Mappings 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);

Note

Returns 0 on success, or -1 on error


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint