Rechercher une page de manuel
mlock
Langue: ja
Version: 2006-02-04 (openSuse - 09/10/07)
Section: 2 (Appels système)
Sommaire
̾Á°
mlock - ¥á¥â¥ê¤Î¥í¥Ã¥¯¤È¥í¥Ã¥¯²ò½ü¤ò¹Ô¤¦½ñ¼°
#include <sys/mman.h> int mlock(const void *addr, size_t len); int munlock(const void *addr, size_t len); int mlockall(int flags); int munlockall(void);
ÀâÌÀ
mlock() ¤È mlockall() ¤Ï¤½¤ì¤¾¤ì¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤ò RAM ¾å¤Ë¥í¥Ã¥¯¤·¡¢¥á¥â¥ê¤¬¥¹¥ï¥Ã¥×¥¨¥ê¥¢¤Ë¥Ú¡¼¥¸¥ó¥°¤µ¤ì¤ë¤Î¤òËɤ°¡£ munlock() ¤È munlockall() ¤ÏµÕ¤ÎÁàºî¤Ç¡¢¤½¤ì¤¾¤ì¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î²¾ÁÛ¥¢¥É¥ì¥¹¶õ´Ö¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤ò ¥í¥Ã¥¯²ò½ü¤¹¤ë¡£¤Ä¤Þ¤ê¡¢»ØÄꤵ¤ì¤¿²¾ÁÛ¥¢¥É¥ì¥¹ÈϰϤΥڡ¼¥¸¤Ï ¥«¡¼¥Í¥ë¥á¥â¥ê¥Þ¥Í¡¼¥¸¥ã¡¼¤«¤éÍ׵ᤵ¤ì¤ì¤Ð¥¹¥ï¥Ã¥×¥¢¥¦¥È¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¡£ ¥á¥â¥ê¤Î¥í¥Ã¥¯¤È¥í¥Ã¥¯²ò½ü¤Ï¥Ú¡¼¥¸Ã±°Ì¤Ç¹Ô¤ï¤ì¤ë¡£mlock() ¤È munlock()
mlock() ¤Ï addr ¤«¤é»Ï¤Þ¤ëŤµ len ¥Ð¥¤¥È¤Î¥¢¥É¥ì¥¹ÈϰϤΥڡ¼¥¸¤ò¥í¥Ã¥¯¤¹¤ë¡£ ¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ »ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹ÈϰϤò´Þ¤àÁ´¤Æ¤Î¥Ú¡¼¥¸¤Ï RAM ¤Ë»Ä¤ê³¤±¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ ¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ï¸å¤Ç¥í¥Ã¥¯²ò½ü¤µ¤ì¤ë¤Þ¤Ç RAM ¤Ë»Ä¤ê³¤±¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£mlockall() ¤È munlockall()
mlockall() ¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò ¥í¥Ã¥¯¤¹¤ë¡£¤³¤ì¤Ë¤Ï¥³¡¼¥É¡¢¥Ç¡¼¥¿¡¢¥¹¥¿¥Ã¥¯¤Î ³Æ¥»¥°¥á¥ó¥È¡¢¶¦Í¥é¥¤¥Ö¥é¥ê¡¢¥«¡¼¥Í¥ë¤Î¥æ¡¼¥¶¡¼¶õ´Ö¥Ç¡¼¥¿¡¢ ¶¦Í¥á¥â¥ê¡¢¥á¥â¥ê¡¦¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤ë¡£ ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬À®¸ù¤·¤¿¾ì¹ç¤Ë¤ÏÁ´¤Æ¤Î¥Þ¥Ã¥×¤µ¤ì¤¿¥Ú¡¼¥¸¤Ï RAM ¤Ë »Ä¤ë¤³¤È¤òÊݾڤµ¤ì¤ë¡£ ¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ï¸å¤Ç¥í¥Ã¥¯²ò½ü¤µ¤ì¤ë¤Þ¤Ç RAM ¤Ë»Ä¤ê³¤±¤ë¤³¤È¤¬Êݾڤµ¤ì¤ë¡£ flags °ú¿ô¤Ï°Ê²¼¤ÎÆâÍƤΰì¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î¥Ó¥Ã¥È OR ¤«¤é¹½À®¤µ¤ì¤ë:- MCL_CURRENT
- ¸½ºß¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò¥í¥Ã¥¯¤¹¤ë¡£
- MCL_FUTURE
- ¾Íè¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤ëÁ´¤Æ¤Î¥Ú¡¼¥¸¤ò¥í¥Ã¥¯¤¹¤ë¡£ Î㤨¤Ð¡¢¥Ò¡¼¥× (heap) ¤ä¥¹¥¿¥Ã¥¯¤ÎÀ®Ä¹¤Ë¤è¤ê¿·¤·¤¯É¬Íפˤʤä¿¥Ú¡¼¥¸¤À¤±¤Ç ¤Ê¤¯¡¢¿·¤·¤¯¥á¥â¥ê¥Þ¥Ã¥×¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ä¶¦Í¥á¥â¥êÎΰè¤â¥í¥Ã¥¯¤µ¤ì¤ë¡£
MCL_FUTURE ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢°Ê¸å¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë (Î㤨¤Ð¡¢ mmap(2), sbrk(2), malloc(3)) ¤Ï¡¢¥í¥Ã¥¯¤¹¤ë¥Ð¥¤¥È¿ô¤¬µö²Ä¤µ¤ì¤¿ºÇÂçÃÍ (²¼µ»²¾È) ¤òĶ¤¨¤¿¾ì¹ç¤Ë ¼ºÇÔ¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£ ƱÍͤˡ¢¥¹¥¿¥Ã¥¯¤ÎÀ®Ä¹¤â¼ºÇÔ¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£ ¤½¤Î¾ì¹ç¡¢¥«¡¼¥Í¥ë¤Ï¥¹¥¿¥Ã¥¯¤Î³ÈÄ¥¤òµñÈݤ·¡¢ SIGSEGV ¤ò¥×¥í¥»¥¹¤ËÁ÷¤ë¡£
munlockall() ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤Æ¤¤¤ë Á´¤Æ¤Î¥Ú¡¼¥¸¤ò¥í¥Ã¥¯²ò½ü¤¹¤ë¡£
ÊÖ¤êÃÍ
À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ ¥¨¥é¡¼¤Î¾ì¹ç¤Ï -1 ¤¬ÊÖ¤µ¤ì¡¢ errno ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¡¢¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤ª¤±¤ë¥í¥Ã¥¯¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£¥¨¥é¡¼
- ENOMEM
- (Linux 2.6.9 °Ê¹ß) ¸Æ¤Ó½Ð¤·¸µ¤ÏÈó¥¼¥í¤Î ¥½¥Õ¥È»ñ¸»À©¸Â RLIMIT_MEMLOCK ¤ò»ý¤Ä¤¬¡¢À©¸Â¤¬µö²Ä¤·¤Æ¤¤¤ë°Ê¾å¤Î¥á¥â¥ê¤ò¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤¿¡£ ¤³¤ÎÀ©¸Â¤Ï¡¢¥×¥í¥»¥¹¤¬Æø¢ (CAP_IPC_LOCK) ¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤ÏŬÍѤµ¤ì¤Ê¤¤¡£
- ENOMEM
- (Linux 2.4 °ÊÁ°) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬ RAM ¤ÎȾʬ°Ê¾å¤ò¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤¿¡£
- EPERM
- (Linux 2.6.9 °Ê¹ß) ¸Æ¤Ó½Ð¤·¸µ¤ÏÆø¢ (CAP_IPC_LOCK) ¤ò»ý¤¿¤º¡¢¥½¥Õ¥È»ñ¸»À©¸Â RLIMIT_MEMLOCK ¤¬ 0 ¤Ç¤¢¤ë¡£
- EPERM
- (Linux 2.6.8 °ÊÁ°) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬ munlockall() ¤ò¸Æ¤Ó½Ð¤¹¤Î¤ËɬÍפÊÆø¢¤ò½êͤ·¤Æ¤¤¤Ê¤«¤Ã¤¿¡£ Linux ¤Ç¤Ï¡¢ CAP_IPC_LOCK ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£
mlock() ¤È munlock() ÍѤȤ·¤Æ:
- EINVAL
- len ¤¬Éé¤Î¿ô¤Ç¤¢¤ë¡£
- EINVAL
- (Linux ¤Ç¤Ï¤³¤Î°ÕÌ£¤Ç»È¤ï¤ì¤Ê¤¤) addr ¤¬¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ï¤Ê¤¤¡£
- ENOMEM
- »ØÄꤵ¤ì¤¿¥¢¥É¥ì¥¹ÈϰϤ¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤¿¥Ú¡¼¥¸¤È °ìÃפ·¤Ê¤¤¡£
mlockall() ÍѤȤ·¤Æ:
- EINVAL
- ̤ÃΤΠflags ¤¬»ØÄꤵ¤ì¤¿¡£
munlockall() ÍѤȤ·¤Æ:
- EPERM
- (Linux 2.6.8 °ÊÁ°) ¸Æ¤Ó½Ð¤·¸µ¤¬¸¢¸Â (CAP_IPC_LOCK) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
½àµò
POSIX.1-2001, SVr4²ÄÍÑÀ
mlock() ¤È munlock() ¤¬»ÈÍѲÄǽ¤Ê POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï _POSIX_MEMLOCK_RANGE ¤¬ <unistd.h> ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ ¤Þ¤¿¡¢¥Ú¡¼¥¸¤¢¤¿¤ê¤Î¥Ð¥¤¥È¿ô¤Ï¡¢ <limits.h> ¤ÇÄêµÁ¤µ¤ì¤ëÄê¿ô PAGESIZE ¤«¤é (ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç)¡¢¤â¤·¤¯¤Ï sysconf(_SC_PAGESIZE) ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç·èÄê¤Ç¤¤ë¡£mlockall() ¤È munlockall() ¤¬ÍøÍѲÄǽ¤Ê POSIX ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ _POSIX_MEMLOCK ¤Ï <unistd.h> ¤Ç 0 ¤è¤êÂ礤¤ÃͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë (sysconf(3) ¤â»²¾È¤Î¤³¤È)¡£
Ãí°Õ
¥á¥â¥ê¤Î¥í¥Ã¥¯¤ÎÍÑÅӤȤ·¤Æ¤Ï¼ç¤ËÆó¤Ä¤¢¤ë: ¥ê¥¢¥ë¥¿¥¤¥à ¥¢¥ë¥´¥ê¥º¥à¤È¹â¤¤¥»¥¥å¥ê¥Æ¥£¤ÎɬÍפʥǡ¼¥¿½èÍý¤Ç¤¢¤ë¡£¥ê¥¢¥ë¥¿¥¤¥à¤Î ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï·èÄêŪ¤Ê¥¿¥¤¥ß¥ó¥°¤ä¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤òɬÍפȤ¹¤ë¤¬¡¢ ¥Ú¡¼¥¸¥ó¥°¤Ïͽ´ü¤·¤Ê¤¤¥×¥í¥°¥é¥à¤Î¼Â¹ÔÃÙ±ä¤ò¤â¤¿¤é¤¹¼çÍפÊÍ×°ø¤È¤Ê¤ë¡£ ¥ê¥¢¥ë¥¿¥¤¥à¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤¿¤¤¤Æ¤¤¤Ï sched_setscheduler(2) ¤Ç¥ê¥¢¥ë¥¿¥¤¥à¥¹¥±¥¸¥å¡¼¥é¤ËÊѹ¹¤µ¤ì¤ë¡£ °Å¹æ¤ä¥»¥¥å¥ê¥Æ¥£¤Î¥½¥Õ¥È¥¦¥§¥¢¤Ï¤·¤Ð¤·¤Ð¥Ñ¥¹¥ï¡¼¥É¤äÈëÌ©¸°¤Î¥Ç¡¼¥¿¤Î ¤è¤¦¤Ê½ÅÍפʥХ¤¥ÈÎó¤ò°·¤¦¡£¥Ú¡¼¥¸¥ó¥°¤Î·ë²Ì¡¢¤³¤ì¤é¤ÎÈëÌ©¤¬ ¥¹¥ï¥Ã¥×ÍѤθÇÄêÇÞÂΤËžÁ÷¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£¤½¤·¤Æ¡¢¥»¥¥å¥ê¥Æ¥£¡¦ ¥½¥Õ¥È¥¦¥§¥¢¤¬ RAM ¾å¤ÎÈëÌ©¤òºï½ü¤·¤Æ½ªÎ»¤·¤¿¤º¤Ã¤È¸å¤Ë¤Ê¤Ã¤Æ¤â¡¢ ¤³¤Î¥¹¥ï¥Ã¥×¤µ¤ì¤¿¥Ç¡¼¥¿¤Ë¤ÏŨ¤¬¥¢¥¯¥»¥¹¤Ç¤¤ë²ÄǽÀ¤¬¤¢¤ë (¤·¤«¤·¡¢¥é¥Ã¥×¥È¥Ã¥×¤È¤¤¤¯¤Ä¤«¤Î¥Ç¥¹¥¯¥È¥Ã¥×¥³¥ó¥Ô¥å¡¼¥¿¤Î ¥µ¥¹¥Ú¥ó¥É¥â¡¼¥É¤Ï¥·¥¹¥Æ¥à¤Î RAM ¤ÎÆâÍƤò¥á¥â¥ê¤Î¥í¥Ã¥¯¤Ë´Ø¤ï¤é¤º ¥Ç¥£¥¹¥¯¤ËÊݸ¤¹¤ë¤³¤È¤ËÃí°Õ)¡£¥ê¥¢¥ë¥¿¥¤¥à¥×¥í¥»¥¹¤¬ mlockall() ¤ò»È¤Ã¤Æ¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¤Ë¤è¤ëÃÙ±ä¤òËɤ´¤¦¤È¤¹¤ë¾ì¹ç¡¢ ´Ø¿ô¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¤¬È¯À¸¤·¤Ê¤¤¤è¤¦¤Ë¡¢ »þ´ÖÀ©¸Â¤Î¸·¤·¤¤Éôʬ (time-critical section) ¤ËÆþ¤ëÁ°¤Ë ½½Ê¬¤ÊÎ̤Υí¥Ã¥¯¤µ¤ì¤¿¥¹¥¿¥Ã¥¯¤ò³ÎÊݤ·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ ¤³¤ì¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¢½½Ê¬¤ÊÂ礤µ¤Î¼«Æ°ÊÑ¿ô (¤ÎÇÛÎó) ¤ò³ÎÊݤ·¡¢ ¤³¤ì¤é¤Î¥¹¥¿¥Ã¥¯ÍѤΥڡ¼¥¸¤¬¥á¥â¥ê¾å¤Ë³ÎÊݤµ¤ì¤ë¤è¤¦¤Ë¤³¤ÎÇÛÎó¤Ë ½ñ¤¹þ¤ß¤ò¹Ô¤¦´Ø¿ô¤òÍÑ°Õ¤·¡¢¤³¤ì¤ò¸Æ¤Ó½Ð¤»¤Ð¤è¤¤¡£¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢ ½½Ê¬¤ÊÎ̤Υڡ¼¥¸¤¬¥¹¥¿¥Ã¥¯¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¡¢RAM ¤Ë¥í¥Ã¥¯¤µ¤ì¤ë¡£ ¥À¥ß¡¼¤Î½ñ¤¹þ¤ß¤ò¹Ô¤¦¤³¤È¤Ë¤è¤Ã¤Æ¡¢ »þ´ÖÀ©¸Â¤Î¸·¤·¤¤Éôʬ (critical section) Æâ¤Ç¤Ï½ñ¤¹þ¤ß»þ¥³¥Ô¡¼¤Ë¤è¤ë ¥Ú¡¼¥¸¥Õ¥©¡¼¥ë¥È¤µ¤¨¤âȯÀ¸¤·¤Ê¤¤¤³¤È¤¬Êݾڤµ¤ì¤ë¡£
¥á¥â¥ê¥í¥Ã¥¯¤Ï fork(2) ¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë¤Ï·Ñ¾µ¤µ¤ì¤º¡¢ execve(2) ¤¬¸Æ¤Ð¤ì¤¿¤ê¡¢¥×¥í¥»¥¹¤¬½ªÎ»¤·¤¿¾ì¹ç¤Ï ¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë (¥í¥Ã¥¯²ò½ü¤µ¤ì¤ë)¡£
¤¢¤ë¥¢¥É¥ì¥¹ÈϰϤËÂФ¹¤ë¥á¥â¥ê¥í¥Ã¥¯¤Ï¡¢¤½¤Î¥¢¥É¥ì¥¹ÈϰϤ¬ munmap(2) ¤Ë¤è¤Ã¤Æ¥¢¥ó¥Þ¥Ã¥×¤µ¤ì¤¿¾ì¹ç¤Ïºï½ü¤µ¤ì¤ë¡£
¥á¥â¥ê¤Î¥í¥Ã¥¯¤ÏÎßÀѤ·¤Ê¤¤¡£ ¤¹¤Ê¤ï¤ÁÊ£¿ô²ó mlock() ¤ä mlockall() ¤ò¸Æ¤Ó½Ð¤·¤Æ¥í¥Ã¥¯¤µ¤ì¤¿¥Ú¡¼¥¸¤Ç¤â¡¢ Âбþ¤¹¤ëÈϰϤËÂФ·¤Æ munlock() ¤ò 1 ²ó¸Æ¤Ó½Ð¤·¤¿¤ê munlockall() ¤ò¸Æ¤Ó½Ð¤·¤¿¤ê¤¹¤ë¤À¤±¤Ç¥í¥Ã¥¯²ò½ü¤µ¤ì¤ë¡£ Ê£¿ô¤Î¾ì½ê¤äÊ£¿ô¤Î¥×¥í¥»¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¥Ú¡¼¥¸¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¾ì½ê¡¢ °ì¤Ä¤Î¥×¥í¥»¥¹¤Ç¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¸Â¤ê¤Ï RAM ¤Ë»Ä¤ê³¤±¤ë¡£
Linux ¤Ç¤ÎÃí°Õ
Linux ¤Ç¤Ï¡¢ mlock() ¤È munlock() ¤Ï¼«Æ°Åª¤Ë addr ¤òü¿ôÀÚ¤ê¼Î¤Æ¤Ë¤è¤ê°ìÈֶᤤ¥Ú¡¼¥¸¶³¦¤Ø¤È´Ý¤á¤ë¡£ ¤·¤«¤· POSIX.1-2001 ¤Ï addr ¤¬¥Ú¡¼¥¸¶³¦¤Ë¹ç¤Ã¤Æ¤¤¤ë¤³¤È¤òÍ׵᤹¤ë¼ÂÁõ¤âµö¤·¤Æ¤¤¤ë¡£ ¤½¤Î¤¿¤á°Ü¿¢À¤ò°Õ¿Þ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤¤Á¤ó¤È¶³¦¤Ë¹ç¤ï¤»¤¿Êý¤¬Îɤ¤¡£À©¸Â¤È¸¢¸Â
Linux 2.6.8 °ÊÁ°¤Ç¤Ï¡¢¥á¥â¥ê¤ò¥í¥Ã¥¯¤¹¤ë¤¿¤á¤Ë¤ÏÆø¢ (CAP_IPC_LOCK) ¤¬É¬Íפǡ¢ ¥½¥Õ¥È»ñ¸»À©¸Â RLIMIT_MEMLOCK ¤Ï¥×¥í¥»¥¹¤¬¤É¤ì¤À¤±¤Î¥á¥â¥ê¤ò¥í¥Ã¥¯¤Ç¤¤ë¤«¤ÎÀ©¸Â¤òÄêµÁ¤¹¤ë¡£Linux 2.6.9 °Ê¹ß¤Ç¤Ï¡¢Æø¢¤ò»ý¤Ä¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤Ç¤¤ë¥á¥â¥êÎ̤Ï̵À©¸Â¤È¤Ê¤ê¡¢ Âå¤ï¤ê¤Ë¥½¥Õ¥È»ñ¸»À©¸Â RLIMIT_MEMLOCK ¤ÏÆø¢¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤Ç¤¤ë¥á¥â¥êÎ̤ÎÀ©¸Â¤òÄêµÁ¤¹¤ë¡£
¥Ð¥°
2.4.17 ¤Þ¤Ç¤Î 2.4 ¥·¥ê¡¼¥º¤Î Linux ¥«¡¼¥Í¥ë¤Ë¤Ï¡¢ mlockall() MCL_FUTURE ¥Õ¥é¥°¤¬ fork(2) ¤Ç·Ñ¾µ¤µ¤ì¤ë¤È¸À¤¦¥Ð¥°¤¬¤¢¤ë¡£ ¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.4.18 ¤Ç½¤Àµ¤µ¤ì¤¿¡£¥«¡¼¥Í¥ë 2.6.9 °Ê¹ß¤Ç¤Ï¡¢Æø¢¤ò»ý¤Ã¤¿¥×¥í¥»¥¹¤¬ mlockall(MCL_FUTURE) ¤ò¸Æ¤Ó½Ð¤·¤¿¸å¤Ç¡¢Æø¢¤ò¤Ê¤¯¤·¤¿¾ì¹ç (Î㤨¤Ð¡¢ ¼Â¸ú UID ¤ò 0 °Ê³°¤ÎÃͤËÊѹ¹¤¹¤ë¤Ê¤É¤Ë¤è¤ê¡¢ CAP_IPC_LOCK ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò¼º¤Ã¤¿¾ì¹ç)¡¢¥ê¥½¡¼¥¹¾å¸Â RLIMIT_MEMLOCK ¤Ë㤹¤ë¤È¡¢¤½¤ì°Ê¹ß¤Î¥á¥â¥ê³ä¤êÅö¤Æ (Î㤨¤Ð mmap(2), brk(2)) ¤Ï¼ºÇÔ¤¹¤ë¡£
´ØÏ¢¹àÌÜ
mmap(2), shmctl(2), setrlimit(2), sysconf(3), capabilities(7)Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre