aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/shm.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-10-13 05:46:48 -0400
committerDavid Howells <dhowells@redhat.com>2012-10-13 05:46:48 -0400
commit607ca46e97a1b6594b29647d98a32d545c24bdff (patch)
tree30f4c0784bfddb57332cdc0678bd06d1e77fa185 /include/linux/shm.h
parent08cce05c5a91f5017f4edc9866cf026908c73f9f (diff)
UAPI: (Scripted) Disintegrate include/linux
Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Michael Kerrisk <mtk.manpages@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'include/linux/shm.h')
-rw-r--r--include/linux/shm.h81
1 files changed, 1 insertions, 80 deletions
diff --git a/include/linux/shm.h b/include/linux/shm.h
index edd086883ccb..bcf8a6a3ec00 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -1,88 +1,11 @@
1#ifndef _LINUX_SHM_H_ 1#ifndef _LINUX_SHM_H_
2#define _LINUX_SHM_H_ 2#define _LINUX_SHM_H_
3 3
4#include <linux/ipc.h>
5#include <linux/errno.h>
6#ifdef __KERNEL__
7#include <asm/page.h> 4#include <asm/page.h>
8#else 5#include <uapi/linux/shm.h>
9#include <unistd.h>
10#endif
11
12/*
13 * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
14 * be increased by sysctl
15 */
16 6
17#define SHMMAX 0x2000000 /* max shared seg size (bytes) */
18#define SHMMIN 1 /* min shared seg size (bytes) */
19#define SHMMNI 4096 /* max num of segs system wide */
20#ifdef __KERNEL__
21#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ 7#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
22#else
23#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
24#endif
25#define SHMSEG SHMMNI /* max shared segs per process */
26
27#ifdef __KERNEL__
28#include <asm/shmparam.h> 8#include <asm/shmparam.h>
29#endif
30
31/* Obsolete, used only for backwards compatibility and libc5 compiles */
32struct shmid_ds {
33 struct ipc_perm shm_perm; /* operation perms */
34 int shm_segsz; /* size of segment (bytes) */
35 __kernel_time_t shm_atime; /* last attach time */
36 __kernel_time_t shm_dtime; /* last detach time */
37 __kernel_time_t shm_ctime; /* last change time */
38 __kernel_ipc_pid_t shm_cpid; /* pid of creator */
39 __kernel_ipc_pid_t shm_lpid; /* pid of last operator */
40 unsigned short shm_nattch; /* no. of current attaches */
41 unsigned short shm_unused; /* compatibility */
42 void *shm_unused2; /* ditto - used by DIPC */
43 void *shm_unused3; /* unused */
44};
45
46/* Include the definition of shmid64_ds and shminfo64 */
47#include <asm/shmbuf.h>
48
49/* permission flag for shmget */
50#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
51#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
52
53/* mode for attach */
54#define SHM_RDONLY 010000 /* read-only access */
55#define SHM_RND 020000 /* round attach address to SHMLBA boundary */
56#define SHM_REMAP 040000 /* take-over region on attach */
57#define SHM_EXEC 0100000 /* execution access */
58
59/* super user shmctl commands */
60#define SHM_LOCK 11
61#define SHM_UNLOCK 12
62
63/* ipcs ctl commands */
64#define SHM_STAT 13
65#define SHM_INFO 14
66
67/* Obsolete, used only for backwards compatibility */
68struct shminfo {
69 int shmmax;
70 int shmmin;
71 int shmmni;
72 int shmseg;
73 int shmall;
74};
75
76struct shm_info {
77 int used_ids;
78 unsigned long shm_tot; /* total allocated shm */
79 unsigned long shm_rss; /* total resident shm */
80 unsigned long shm_swp; /* total swapped shm */
81 unsigned long swap_attempts;
82 unsigned long swap_successes;
83};
84
85#ifdef __KERNEL__
86struct shmid_kernel /* private to the kernel */ 9struct shmid_kernel /* private to the kernel */
87{ 10{
88 struct kern_ipc_perm shm_perm; 11 struct kern_ipc_perm shm_perm;
@@ -127,6 +50,4 @@ static inline void exit_shm(struct task_struct *task)
127} 50}
128#endif 51#endif
129 52
130#endif /* __KERNEL__ */
131
132#endif /* _LINUX_SHM_H_ */ 53#endif /* _LINUX_SHM_H_ */