Commit | Line | Data |
---|---|---|
93bcfd20 BC |
1 | #ifndef SYS_SHM_H\r |
2 | #define SYS_SHM_H\r | |
3 | \r | |
4 | #define IPC_RMID 0x1\r | |
5 | #define IPC_CREAT 0x2\r | |
6 | #define IPC_PRIVATE 0x4\r | |
7 | \r | |
8 | typedef int uid_t;\r | |
9 | typedef int gid_t;\r | |
10 | \r | |
11 | typedef int shmatt_t;\r | |
12 | typedef int key_t;\r | |
13 | \r | |
14 | struct ipc_perm\r | |
15 | {\r | |
16 | uid_t uid; //owner's user ID\r | |
17 | gid_t gid; //owner's group ID\r | |
18 | uid_t cuid; //creator's user ID\r | |
19 | gid_t cgid; //creator's group ID\r | |
20 | mode_t mode; //read/write permission\r | |
21 | };\r | |
22 | \r | |
23 | \r | |
24 | struct shmid_ds\r | |
25 | {\r | |
26 | struct ipc_perm shm_perm; //operation permission structure\r | |
27 | size_t shm_segsz; //size of segment in bytes\r | |
28 | pid_t shm_lpid; //process ID of last shared memory operation\r | |
29 | pid_t shm_cpid; //process ID of creator\r | |
30 | shmatt_t shm_nattch; //number of current attaches\r | |
31 | time_t shm_atime; //time of last shmat()\r | |
32 | time_t shm_dtime; //time of last shmdt()\r | |
33 | time_t shm_ctime; //time of last change by shmctl()\r | |
34 | };\r | |
35 | \r | |
36 | int shmctl(int shmid, int cmd, struct shmid_ds *buf);\r | |
37 | int shmget(key_t key, size_t size, int shmflg);\r | |
38 | void *shmat(int shmid, const void *shmaddr, int shmflg);\r | |
39 | int shmdt(const void *shmaddr);\r | |
40 | \r | |
41 | #endif /* SYS_SHM_H */\r |