.\"WORD: protection ¥¢¥¯¥»¥¹Êݸî
.\"WORD: read-only Æɤ߼è¤êÀìÍÑ
.\"
-.TH MPROTECT 2 2008-08-06 "Linux" "Linux Programmer's Manual"
+.TH MPROTECT 2 2011-09-08 "Linux" "Linux Programmer's Manual"
.\"O .SH NAME
.SH ̾Á°
.\"O mprotect \- set protection on a region of memory
.B ENOMEM
.\"O Addresses in the range
.\"O .RI [ addr ,
-.\"O .IR addr + len ]
+.\"O .IR addr + len \-1]
.\"O are invalid for the address space of the process,
.\"O or specify one or more pages that are not mapped.
.\"O (Before kernel 2.4.19, the error
.\"O .BR EFAULT
.\"O was incorrectly produced for these cases.)
.RI [ addr ,
-.IR addr + len ]
+.IR addr + len \-1]
¤È¤¤¤¦ÈϰϤΥ¢¥É¥ì¥¹¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤È¤·¤ÆÉÔÀµ¤Ç¤¢¤ë¤«¡¢
¤½¤ÎÈϰϤΥ¢¥É¥ì¥¹¤¬¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤ 1 ¤Ä°Ê¾å¤Î¥Ú¡¼¥¸¤ò»Ø¤·¤Æ¤¤¤ë
(¥«¡¼¥Í¥ë 2.4.19 ¤è¤êÁ°¤Ç¤Ï¡¢¤³¤Î¾õ¶·¤Ç¥¨¥é¡¼
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 ; ; )