summaryrefslogtreecommitdiff
path: root/man2/mprotect.2
diff options
context:
space:
mode:
Diffstat (limited to 'man2/mprotect.2')
-rw-r--r--man2/mprotect.212
1 files changed, 6 insertions, 6 deletions
diff --git a/man2/mprotect.2 b/man2/mprotect.2
index fbf6d224..c68b6f43 100644
--- a/man2/mprotect.2
+++ b/man2/mprotect.2
@@ -38,7 +38,7 @@ mprotect \- control allowable accesses to a region of memory
.fi
.SH DESCRIPTION
The function
-.B mprotect
+.BR mprotect ()
specifies the desired protection for the memory page(s) containing
part or all of the interval [\fIaddr\fP,\fIaddr\fP+\fIlen\fP-1].
If an access is disallowed by the protection given it, the program receives a
@@ -60,12 +60,12 @@ The memory can be written to.
The memory can contain executing code.
.PP
The new protection replaces any existing protection. For example, if the
-memory had previously been marked \fBPROT_READ\fR, and \fBmprotect\fR
+memory had previously been marked \fBPROT_READ\fR, and \fBmprotect\fR()
is then called with \fIprot\fR \fBPROT_WRITE\fR, it will no longer
be readable.
.SH "RETURN VALUE"
On success,
-.B mprotect
+.BR mprotect ()
returns zero. On error, \-1 is returned, and
.I errno
is set appropriately.
@@ -76,7 +76,7 @@ The memory cannot be given the specified access. This can happen,
for example, if you
.BR mmap (2)
a file to which you have read-only access, then ask
-.B mprotect
+.BR mprotect ()
to mark it
.BR PROT_WRITE .
.TP
@@ -141,12 +141,12 @@ main(void)
SVr4, POSIX.1b (formerly POSIX.4). SVr4 defines an additional error
code EAGAIN. The SVr4 error conditions don't map neatly onto Linux's.
POSIX says that
-.B mprotect
+.BR mprotect ()
can be used only on regions of memory obtained from
.BR mmap (2).
.SH NOTES
On Linux it is always legal to call
-.B mprotect
+.BR mprotect ()
on any address in a process' address space (except for the
kernel vsyscall area). In particular it can be used
to change existing code mappings to be writable.