mirror of https://github.com/mkerrisk/man-pages
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:
parent
4b9999d6e7
commit
7d9da03f0f
|
@ -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 ; ; )
|
||||
|
|
Loading…
Reference in New Issue