xref: /original-bsd/lib/libc/sys/madvise.2 (revision 3705696b)
1.\" Copyright (c) 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)madvise.2	8.1 (Berkeley) 06/09/93
7.\"
8.Dd
9.Dt MADVISE 2
10.Os
11.Sh NAME
12.Nm madvise
13.Nd give advise about use of memory
14.Sh SYNOPSIS
15.Fn madvise "caddr_t addr" "int len" "int behav"
16.Sh DESCRIPTION
17The
18.Fn madvise
19system call
20allows a process that has knowledge of its memory behavior
21to describe it to the system.
22The known behaviors are given in
23.Pa <sys/mman.h> :
24.Bd -literal
25#define	MADV_NORMAL	0	/* no further special treatment */
26#define	MADV_RANDOM	1	/* expect random page references */
27#define	MADV_SEQUENTIAL	2	/* expect sequential references */
28#define	MADV_WILLNEED	3	/* will need these pages */
29#define	MADV_DONTNEED	4	/* don't need these pages */
30#define	MADV_SPACEAVAIL	5	/* insure that resources are reserved */
31.Ed
32.Sh SEE ALSO
33.Xr msync 2 ,
34.Xr munmap 2 ,
35.Xr mprotect 2 ,
36.Xr mincore 2
37.Sh HISTORY
38The
39.Nm madvise
40function first appeared in 4.4BSD.
41