.\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" %sccs.include.redist.roff% .\" .\" @(#)madvise.2 8.1 (Berkeley) 06/09/93 .\" .Dd .Dt MADVISE 2 .Os .Sh NAME .Nm madvise .Nd give advise about use of memory .Sh SYNOPSIS .Fn madvise "caddr_t addr" "int len" "int behav" .Sh DESCRIPTION The .Fn madvise system call allows a process that has knowledge of its memory behavior to describe it to the system. The known behaviors are given in .Pa : .Bd -literal #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 /* insure that resources are reserved */ .Ed .Sh SEE ALSO .Xr msync 2 , .Xr munmap 2 , .Xr mprotect 2 , .Xr mincore 2 .Sh HISTORY The .Nm madvise function first appeared in 4.4BSD.