mprotect.2: Fix small bug in example program

The description of the example program says that it makes the
third page "read-only". Thus use PROT_READ instead of PROT_NONE.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Seonghun Lim 2011-09-08 17:27:59 +02:00 committed by Michael Kerrisk
parent 4b9999d6e7
commit 7d9da03f0f
1 changed files with 1 additions and 1 deletions

View File

@ -207,7 +207,7 @@ main(int argc, char *argv[])
printf("Start of region: 0x%lx\\n", (long) buffer);
if (mprotect(buffer + pagesize * 2, pagesize,
PROT_NONE) == \-1)
PROT_READ) == \-1)
handle_error("mprotect");
for (p = buffer ; ; )