summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1997-01-11 23:20:29 +0000
committermpp <mpp@FreeBSD.org>1997-01-11 23:20:29 +0000
commitc9234ddda18afbf9582bb59a03653a7c27070bd3 (patch)
treeeecfdfe9c5f51eea7c82a0f0e358da5cc37171af /lib/libc
parent0d991be0429564ed73e02ac910ed866bb4c6345c (diff)
downloadFreeBSD-src-c9234ddda18afbf9582bb59a03653a7c27070bd3.zip
FreeBSD-src-c9234ddda18afbf9582bb59a03653a7c27070bd3.tar.gz
Add RETURN VALUES and ERRORS sections.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/mprotect.231
1 files changed, 28 insertions, 3 deletions
diff --git a/lib/libc/sys/mprotect.2 b/lib/libc/sys/mprotect.2
index 51d1b14..48fcb32 100644
--- a/lib/libc/sys/mprotect.2
+++ b/lib/libc/sys/mprotect.2
@@ -40,6 +40,7 @@
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <sys/mman.h>
+.Ft int
.Fn mprotect "caddr_t addr" "size_t len" "int prot"
.Sh DESCRIPTION
The
@@ -49,11 +50,35 @@ changes the specified pages to have protection
.Fa prot .
Not all implementations will guarantee protection on a page basis;
the granularity of protection changes may be as large as an entire region.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn mprotect
+returns 0. Otherwise a value of -1 is returned
+and
+.Va errno
+is set to indicate the error.
+.Sh ERRORS
+The
+.Fn mprotect
+function will fail if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The virtual address range specified by the
+.Fa addr
+and
+.Fa len
+arguments is not valid.
+.It Bq Er EACCES
+The calling process was not allowed to change
+the protection to the value specified by
+the
+.Fa prot
+argument.
.Sh SEE ALSO
-.Xr msync 2 ,
-.Xr munmap 2 ,
.Xr madvise 2 ,
-.Xr mincore 2
+.Xr mincore 2 ,
+.Xr msync 2 ,
+.Xr munmap 2
.Sh HISTORY
The
.Fn mprotect
OpenPOWER on IntegriCloud