1 #ifndef _LINUX_SHM_H_
2 #define _LINUX_SHM_H_
3
4 #include <linux/ipc.h>
5
6 #include <asm/shmparam.h>
7
8 struct shmid_ds {
9 struct ipc_perm shm_perm;
10 int shm_segsz;
11 time_t shm_atime;
12 time_t shm_dtime;
13 time_t shm_ctime;
14 unsigned short shm_cpid;
15 unsigned short shm_lpid;
16 short shm_nattch;
17
18 unsigned short shm_npages;
19 unsigned long *shm_pages;
20 struct vm_area_struct *attaches;
21 };
22
23
24 #define SHM_R 0400
25 #define SHM_W 0200
26
27
28 #define SHM_RDONLY 010000
29 #define SHM_RND 020000
30 #define SHM_REMAP 040000
31
32
33 #define SHM_LOCK 11
34 #define SHM_UNLOCK 12
35
36 struct shminfo {
37 int shmmax;
38 int shmmin;
39 int shmmni;
40 int shmseg;
41 int shmall;
42 };
43
44 #ifdef __KERNEL__
45
46
47 #define SHM_DEST 01000
48 #define SHM_LOCKED 02000
49
50
51 #define SHM_STAT 13
52 #define SHM_INFO 14
53 struct shm_info {
54 int used_ids;
55 ulong shm_tot;
56 ulong shm_rss;
57 ulong shm_swp;
58 ulong swap_attempts;
59 ulong swap_successes;
60 };
61
62 asmlinkage int sys_shmget (key_t key, int size, int flag);
63 asmlinkage int sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *addr);
64 asmlinkage int sys_shmdt (char *shmaddr);
65 asmlinkage int sys_shmctl (int shmid, int cmd, struct shmid_ds *buf);
66
67 #endif
68
69 #endif
70