Skip to contentSkip to conversation

mprotect.2: update example program

PATCH In review Seonghun Lim 2 participants 2 messages Aug 31, 2011 – Sep 8, 2011 1 message not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mprotect.2: update example program

man-pages version: latest git repository
why: The description of the example program says that it makes the third page "read-only". Thus PROT_READ instead of PROT_NONE.

man2/mprotect.2 +0 -0
@@ -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 ; ; )

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

2011/8/31 Seonghun Lim <[email protected]>:

Quoted 3 lines

man-pages version: latest git repository
why: The description of the example program says that it makes the third page "read-only". Thus PROT_READ instead of PROT_NONE.

Thanks. Applied for 3.33.

Cheers,

Michael

Quoted 14 lines
man2/mprotect.2 +1 -1
@@ -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 ; ; )
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html