¸®´ª½º ÇÁ·Î±×·¡¸Ó¸¦ À§ÇÑ °¡À̵å
³»ºÎ¿Í »ç¿ëÀÚ ÀÚ·á ±¸Á¶ (Internal and User Data Structures)
°øÀ¯ ¸Þ¸ð¸® ¼¼±×¸ÕÆ®¸¦ À§ÇØ Ä¿³Î¿¡¼ °ü¸®µÇ´Â ÀÚ·á ±¸Á¶¸¦ °£´ÜÈ÷ »ìÆ캸ÀÚ.
Kernel shmid_ds structure
¸Þ¼¼Áö Å¥ ¶Ç´Â ¼¼¸¶ÆÛ ÁýÇÕ¿¡¼¿Í °°ÀÌ, Ä¿³ÎÀº ÁÖ¼Ò °ø°£¾ÈÀÌ Á¸ÀçÇÏ´Â °¢°¢ÀÇ °øÀ¯ ¸Þ¸ð¸®
¼¼±×¸ÕÆ®¿¡ ´ëÇØ Æ¯º°ÇÑ ³»ºÎ ÀÚ·á ±¸Á¶¸¦ °ü¸®ÇÑ´Ù. ÀÌ ±¸Á¶´Â shmid_ds ŸÀÔÀ¸·Î ´ÙÀ½°ú °°ÀÌ
linux/shm.h¿¡ Á¤ÀǵǾîÀÖ´Ù.
/* ½Ã½ºÅ۾ȿ¡¼ °¢ °øÀ¯ ¸Þ¸ð¸® ¼¼±×¸ÕÆ®¿¡ ´ëÇÑ shmid ÀÚ·á ±¸Á¶ */
struct shmid_ds {
struct ipc_perm shm_perm; /* µ¿ÀÛ Çã°¡»çÇ× */
int shm_segsz; /* ¼¼±×¸ÕÆ®ÀÇ Å©±â(bytes) */
time_t shm_atime; /* ¸¶Áö¸· attach ½Ã°£ */
time_t shm_dtime; /* ¸¶Áö¸· detach ½Ã°£ */
time_t shm_ctime; /* ¸¶Áö¸· change ½Ã°£ */
unsigned short shm_cpid; /* »ý¼ºÀÚÀÇ pid */
unsigned short shm_lpid; /* ¸¶Áö¸· µ¿ÀÛÀÚÀÇ pid */
short shm_nattch; /* ÇöÀç attaches no. */
/* the following are private */
unsigned short shm_npages; /* ¼¼±×¸ÕÆ®ÀÇ Å©±â (pages) */
unsigned long *shm_pages; /* array of ptrs to frames -> SHMMAX */
struct vm_area_struct *attaches; /* descriptors for attaches */
};
ÀÌ ±¸Á¶»óÀÇ µ¿ÀÛÀº Ưº°ÇÑ ½Ã½ºÅÛ È£Ãâ¿¡ ÀÇÇظ¸ ¼öÇàµÇ°í, Á÷Á¢ÀûÀ¸·Î ´Ù·ç¾î ÁöÁö ¸»¾Æ¾ß ÇÑ´Ù.
¿©±â º¸´Ù ÀûÀýÇÑ ÇʵåÀÇ ¼³¸íÀÌ ÀÖ´Ù.
- shm_perm
- ÀÌ°ÍÀº ipc-perm ±¸Á¶Ã¼ÀÇ ÇÑ ¿¹·Î, linux/ipc.h ¾È¿¡ Á¤¿ÜµÇ¾îÀÖ´Ù. ÀÌ°ÍÀº ¼¼±×¸ÕÆ®ÀÇ
»ý¼ºÀÚ¿¡ ´ëÇÑ Á¤º¸¿Í Á¢±Ù Çã°¡»çÇ×À» Æ÷ÇÔÇÑ ¼¼±×¸ÕÆ®¿¡ ´ëÇÑ Çã°¡»çÇ× Á¤º¸¸¦ °®´Â´Ù.
- shm_segsz
- ¼¼±×¸ÕÆ®ÀÇ Å©±â (bytes·Î ÃøÁ¤µÈ)
- shm_atime
- ¸¶Áö¸· ÇÁ·Î¼¼½º°¡ ¼¼±×¸ÕÆ®¸¦ attachÇÑ ½Ã°£
- shm_dtime
- ¸¶Áö¸· ÇÁ·Î¼¼½º°¡ ¼¼±×¸ÕÆ®¸¦ detachÇÑ ½Ã°£
- shm_ctime
- ÀÌ ±¸Á¶°¡ ¸¶Áö¸·À¸·Î ¹Ù²ï ½Ã°£ (mode change, etc)
- shm_cpid
- »ý¼ºÇÑ ÇÁ·Î¼¼½ºÀÇ PID
- shm_lpid
- ¼¼±×¸ÕÆ®¿¡¼ µ¿ÀÛÀ» ¼öÇàÇÑ ¸¶Áö¸· ÇÁ·Î¼¼½ºÀÇ PID
- shm_nattch
- ÇöÀç ¼¼±×¸ÕÆ®¿¡ attachµÈ ÇÁ·Î¼¼½ºÀÇ ¼ö
ÀÌÀü:±âº» °³³ä (Basic Concepts)
´ÙÀ½:½Ã½ºÅÛ È£Ãâ:shmget()
Copyright (c) 1996,1997 by Euibeom.Hwang & SangEun.Oh All Rights Reserved
Email To:Webmaster ,
Another address
LAST UPDATE Nov 28,1997
Created Nov 28,1997