Back to index

glibc  2.9
posix_madvise.c File Reference
#include <sysdep.h>
#include <sys/mman.h>

Go to the source code of this file.


int posix_madvise (void *addr, size_t len, int advice)

Function Documentation

int posix_madvise ( void *  addr,
size_t  len,
int  advice 

Definition at line 24 of file posix_madvise.c.

  /* We have one problem: the kernel's MADV_DONTNEED does not
     correspond to POSIX's POSIX_MADV_DONTNEED.  The former simply
     discards changes made to the memory without writing it back to
     disk, if this would be necessary.  The POSIX behavior does not
     allow this.  There is no functionality mapping the POSIX behavior
     so far so we ignore that advice for now.  */
  if (advice == POSIX_MADV_DONTNEED)
    return 0;

  int result = INTERNAL_SYSCALL (madvise, err, 3, addr, len, advice);
  return INTERNAL_SYSCALL_ERRNO (result, err);

Here is the call graph for this function: