6 #include <asm/shmparam.h>
9 struct ipc_perm shm_perm
; /* operation perms */
10 int shm_segsz
; /* size of segment (bytes) */
11 __kernel_time_t shm_atime
; /* last attach time */
12 __kernel_time_t shm_dtime
; /* last detach time */
13 __kernel_time_t shm_ctime
; /* last change time */
14 __kernel_ipc_pid_t shm_cpid
; /* pid of creator */
15 __kernel_ipc_pid_t shm_lpid
; /* pid of last operator */
16 unsigned short shm_nattch
; /* no. of current attaches */
17 /* the following are private */
18 unsigned short shm_npages
; /* size of segment (pages) */
19 unsigned long *shm_pages
; /* array of ptrs to frames -> SHMMAX */
20 struct vm_area_struct
*attaches
; /* descriptors for attaches */
23 /* permission flag for shmget */
24 #define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
25 #define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
28 #define SHM_RDONLY 010000 /* read-only access */
29 #define SHM_RND 020000 /* round attach address to SHMLBA boundary */
30 #define SHM_REMAP 040000 /* take-over region on attach */
32 /* super user shmctl commands */
36 /* ipcs ctl commands */
50 unsigned long shm_tot
; /* total allocated shm */
51 unsigned long shm_rss
; /* total resident shm */
52 unsigned long shm_swp
; /* total swapped shm */
53 unsigned long swap_attempts
;
54 unsigned long swap_successes
;
59 /* shm_mode upper byte flags */
60 #define SHM_DEST 01000 /* segment will be destroyed on last detach */
61 #define SHM_LOCKED 02000 /* segment will not be swapped */
63 asmlinkage
int sys_shmget (key_t key
, int size
, int flag
);
64 asmlinkage
int sys_shmat (int shmid
, char *shmaddr
, int shmflg
, unsigned long *addr
);
65 asmlinkage
int sys_shmdt (char *shmaddr
);
66 asmlinkage
int sys_shmctl (int shmid
, int cmd
, struct shmid_ds
*buf
);
67 extern void shm_unuse(unsigned long entry
, unsigned long page
);
69 #endif /* __KERNEL__ */
71 #endif /* _LINUX_SHM_H_ */