Blog literacki, portal erotyczny - seks i humor nie z tej ziemi
Next: SYSTEM CALL: shmget() Up: Internal and User Data Previous: Internal and User DataKernel shmid_ds structureAs with message queues and semaphore sets, the kernel maintains a special internal data structure for each shared memory segment which exists within its addressing space. This structure is of type shmid_ds, and is defined in linux/shm.h as follows: /* One shmid data structure for each shared memory segment in the system. */ struct shmid_ds { struct ipc_perm shm_perm; /* operation perms */ int shm_segsz; /* size of segment (bytes) */ time_t shm_atime; /* last attach time */ time_t shm_dtime; /* last detach time */ time_t shm_ctime; /* last change time */ unsigned short shm_cpid; /* pid of creator */ unsigned short shm_lpid; /* pid of last operator */ short shm_nattch; /* no. of current attaches */ /* the following are private */ unsigned short shm_npages; /* size of segment (pages) */ unsigned long *shm_pages; /* array of ptrs to frames -> SHMMAX */ struct vm_area_struct *attaches; /* descriptors for attaches */ };Operations on this structure are performed by a special system call, and should not be tinkered with directly. Here are descriptions of the more pertinent fields:shm_permThis is an instance of the ipc_perm structure, which is defined for us in linux/ipc.h. This holds the permission information for the segment, including the access permissions, and information about the creator of the segment (uid, etc).shm_segszSize of the segment (measured in bytes).shm_atimeTime the last process attached the segment.shm_dtimeTime the last process detached the segment.shm_ctimeTime of the last change to this structure (mode change, etc).shm_cpidThe PID of the creating process.shm_lpidThe PID of the last process to operate on the segment.shm_nattchNumber of processes currently attached to the segment.Converted on:Fri Mar 29 14:43:04 EST 1996