Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/mprotect.2
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||||||
.Fn mprotect "void *addr" "size_t len" "int prot" | .Fn mprotect "void *addr" "size_t len" "int prot" | ||||||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||||||
The | The | ||||||||
.Fn mprotect | .Fn mprotect | ||||||||
system call | system call | ||||||||
changes the specified pages to have protection | changes the specified pages to have protection | ||||||||
.Fa prot . | .Fa prot . | ||||||||
.Pp | .Pp | ||||||||
Currently these protection bits are known, | The | ||||||||
which can be combined, OR'd together: | .Fa prot | ||||||||
argument shall be the bitwise OR of one or more of the following values: | |||||||||
.Pp | .Pp | ||||||||
.Bl -tag -width ".Dv PROT_WRITE" -compact | .Bl -tag -width ".Dv PROT_WRITE" -compact | ||||||||
markjUnsubmitted Done Inline Actions
markj: | |||||||||
.It Dv PROT_NONE | .It Dv PROT_NONE | ||||||||
No permissions at all. | No permissions at all. | ||||||||
markjUnsubmitted Done Inline ActionsTechnically, the argument should be the bitwise OR of some subset of {READ, WRITE, EXEC} or PROT_NONE. ORing PROT_NONE with other flags does nothing. markj: Technically, the argument should be the bitwise OR of some subset of {READ, WRITE, EXEC} or… | |||||||||
.It Dv PROT_READ | .It Dv PROT_READ | ||||||||
The pages can be read. | The pages can be read. | ||||||||
.It Dv PROT_WRITE | .It Dv PROT_WRITE | ||||||||
The pages can be written. | The pages can be written. | ||||||||
.It Dv PROT_EXEC | .It Dv PROT_EXEC | ||||||||
The pages can be executed. | The pages can be executed. | ||||||||
.El | .El | ||||||||
.Pp | .Pp | ||||||||
In addition to these protection flags, | In addition to these standard protection flags, | ||||||||
the | |||||||||
.Fx | .Fx | ||||||||
implementation of | |||||||||
.Fn mprotect | |||||||||
provides the ability to set the maximum protection of a region | provides the ability to set the maximum protection of a region | ||||||||
(which prevents | (which prevents | ||||||||
.Nm | .Nm | ||||||||
from upgrading the permissions). | from upgrading the permissions). | ||||||||
Done Inline ActionsWhile we're here, I would suggest adding the word "later" here, i.e., saying, "... from later upgrading ..." Also, wouldn't "adding" be clearer than "upgrading"? alc: While we're here, I would suggest adding the word "later" here, i.e., saying, "... from later… | |||||||||
This is accomplished by | This is accomplished by | ||||||||
.Em or Ns 'ing | .Em or Ns 'ing | ||||||||
Done Inline ActionsAdd the word "bitwise" here, like above? alc: Add the word "bitwise" here, like above? | |||||||||
one or more | one or more | ||||||||
.Dv PROT_ | .Dv PROT_ | ||||||||
values wrapped in the | values wrapped in the | ||||||||
.Dv PROT_MAX() | .Dv PROT_MAX() | ||||||||
macro into the | macro into the | ||||||||
.Fa prot | .Fa prot | ||||||||
argument. | argument. | ||||||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |