1 #ifndef _UAPI_LINUX_SHM_H_
2 #define _UAPI_LINUX_SHM_H_
5 #include <linux/errno.h>
11 * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
12 * be increased by sysctl
15 #define SHMMAX 0x2000000 /* max shared seg size (bytes) */
16 #define SHMMIN 1 /* min shared seg size (bytes) */
17 #define SHMMNI 4096 /* max num of segs system wide */
19 #define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
21 #define SHMSEG SHMMNI /* max shared segs per process */
24 /* Obsolete, used only for backwards compatibility and libc5 compiles */
26 struct ipc_perm shm_perm; /* operation perms */
27 int shm_segsz; /* size of segment (bytes) */
28 __kernel_time_t shm_atime; /* last attach time */
29 __kernel_time_t shm_dtime; /* last detach time */
30 __kernel_time_t shm_ctime; /* last change time */
31 __kernel_ipc_pid_t shm_cpid; /* pid of creator */
32 __kernel_ipc_pid_t shm_lpid; /* pid of last operator */
33 unsigned short shm_nattch; /* no. of current attaches */
34 unsigned short shm_unused; /* compatibility */
35 void *shm_unused2; /* ditto - used by DIPC */
36 void *shm_unused3; /* unused */
39 /* Include the definition of shmid64_ds and shminfo64 */
40 #include <asm/shmbuf.h>
42 /* permission flag for shmget */
43 #define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
44 #define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
47 #define SHM_RDONLY 010000 /* read-only access */
48 #define SHM_RND 020000 /* round attach address to SHMLBA boundary */
49 #define SHM_REMAP 040000 /* take-over region on attach */
50 #define SHM_EXEC 0100000 /* execution access */
52 /* super user shmctl commands */
56 /* ipcs ctl commands */
60 /* Obsolete, used only for backwards compatibility */
71 __kernel_ulong_t shm_tot; /* total allocated shm */
72 __kernel_ulong_t shm_rss; /* total resident shm */
73 __kernel_ulong_t shm_swp; /* total swapped shm */
74 __kernel_ulong_t swap_attempts;
75 __kernel_ulong_t swap_successes;
79 #endif /* _UAPI_LINUX_SHM_H_ */