shm.h
01: #ifndef _LINUX_SHM_H_
02: #define _LINUX_SHM_H_
03:
04: #include <linux/ipc.h>
05: #include <linux/errno.h>
06: #include <unistd.h>
07:
08:
09:
10:
11:
12:
13: #define SHMMAX 0x2000000
14: #define SHMMIN 1
15: #define SHMMNI 4096
16: #define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
17: #define SHMSEG SHMMNI
18:
19:
20:
21: struct shmid_ds {
22: struct ipc_perm shm_perm;
23: int shm_segsz;
24: __kernel_time_t shm_atime;
25: __kernel_time_t shm_dtime;
26: __kernel_time_t shm_ctime;
27: __kernel_ipc_pid_t shm_cpid;
28: __kernel_ipc_pid_t shm_lpid;
29: unsigned short shm_nattch;
30: unsigned short shm_unused;
31: void *shm_unused2;
32: void *shm_unused3;
33: };
34:
35:
36: #include <asm/shmbuf.h>
37:
38:
39: #define SHM_R 0400
40: #define SHM_W 0200
41:
42:
43: #define SHM_RDONLY 010000
44: #define SHM_RND 020000
45: #define SHM_REMAP 040000
46: #define SHM_EXEC 0100000
47:
48:
49: #define SHM_LOCK 11
50: #define SHM_UNLOCK 12
51:
52:
53: #define SHM_STAT 13
54: #define SHM_INFO 14
55:
56:
57: struct shminfo {
58: int shmmax;
59: int shmmin;
60: int shmmni;
61: int shmseg;
62: int shmall;
63: };
64:
65: struct shm_info {
66: int used_ids;
67: unsigned long shm_tot;
68: unsigned long shm_rss;
69: unsigned long shm_swp;
70: unsigned long swap_attempts;
71: unsigned long swap_successes;
72: };
73:
74:
75: #endif
76:
© Andrew Scott 2006 -
2025,
All Rights Reserved