summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorart <art@openbsd.org>2001-05-10 14:53:22 +0000
committerart <art@openbsd.org>2001-05-10 14:53:22 +0000
commit5d5ff82be58816e2cad67110cb1f0a1ce399cbce (patch)
treec8cd2cd2880cd9ab91265bdcc1d71032a1031cde /lib/libc
parentMore sync to NetBSD. (diff)
downloadwireguard-openbsd-5d5ff82be58816e2cad67110cb1f0a1ce399cbce.tar.xz
wireguard-openbsd-5d5ff82be58816e2cad67110cb1f0a1ce399cbce.zip
Slightly better explaination of the advices (cut 'n paste from sys/mman.h is
not good documentation) and document the new ones. Also, remove the BUGS section that said it wasn't implemented.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/madvise.233
1 files changed, 18 insertions, 15 deletions
diff --git a/lib/libc/sys/madvise.2 b/lib/libc/sys/madvise.2
index 8fe94c7e105..2909bea0208 100644
--- a/lib/libc/sys/madvise.2
+++ b/lib/libc/sys/madvise.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: madvise.2,v 1.10 1999/06/29 14:10:05 aaron Exp $
+.\" $OpenBSD: madvise.2,v 1.11 2001/05/10 14:53:22 art Exp $
.\" $NetBSD: madvise.2,v 1.7 1995/12/27 21:17:02 jtc Exp $
.\"
.\" Copyright (c) 1991, 1993
@@ -51,16 +51,23 @@ The
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 <sys/mman.h> :
-.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
+The possible behaviors are:
+.Bl -tag -width MADV_SEQUENTIAL
+.It Dv MADV_NORMAL
+No further special treatment needed.
+.It Dv MADV_RANDOM
+Expect random page access patterns.
+.It Dv MADV_SEQUENTIAL
+Expect sequential page references.
+.It Dv MADV_WILLNEED
+The pages will be referenced soon.
+.It Dv MADV_DONTNEED
+The pages will not be referenced soon.
+.It Dv MADV_SPACEAVAIL
+Insure that resources are reserved.
+.It Dv MADV_FREE
+The pages don't contain any useful data and can be recycled.
+.El
.Sh RETURN VALUES
Upon successful completion,
a value of 0 is returned.
@@ -73,10 +80,6 @@ is set to indicate the error.
.Xr mprotect 2 ,
.Xr msync 2 ,
.Xr munmap 2
-.Sh BUGS
-The
-.Fn madvise
-function is not implemented in the current vm subsystem.
.Sh HISTORY
The
.Nm madvise