madvise(2) - NetBSD Manual Pages

MADVISE(2)                NetBSD System Calls Manual                MADVISE(2)


NAME
madvise -- give advice about use of memory
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/mman.h> int madvise(void *addr, size_t len, int behav);
DESCRIPTION
The madvise() system call allows a process that has knowledge of its mem- ory behavior to describe it to the system. The known behaviors are given in <sys/mman.h>: #define MADV_NORMAL 0 /* no further special treatment */ #define MADV_RANDOM 1 /* expect random page references */ #define MADV_SEQUENTIAL 2 /* expect sequential references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_DONTNEED 4 /* don't need these pages */ #define MADV_SPACEAVAIL 5 /* ensure that resources are reserved */ #define MADV_FREE 6 /* pages are empty, free them */
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
SEE ALSO
mincore(2), mprotect(2), msync(2), munmap(2)
HISTORY
The madvise system call first appeared in 4.4BSD, but until NetBSD 1.5 it did not perform any of the requests on, or change any behavior of the address range given. NetBSD 3.0.1 August 11, 2002 NetBSD 3.0.1

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.