4 #include <linux/types.h>
6 #define IPC_PRIVATE ((__kernel_key_t) 0)
8 /* Obsolete, used only for backwards compatibility and libc5 compiles */
20 /* Include the definition of ipc64_perm */
21 #include <asm/ipcbuf.h>
23 /* resource get request flags */
24 #define IPC_CREAT 00001000 /* create if key is nonexistent */
25 #define IPC_EXCL 00002000 /* fail if key exists */
26 #define IPC_NOWAIT 00004000 /* return error on wait */
28 /* these fields are used by the DIPC package so the kernel as standard
29 should avoid using them if possible */
31 #define IPC_DIPC 00010000 /* make it distributed */
32 #define IPC_OWN 00020000 /* this machine is the DIPC owner */
35 * Control commands used with semctl, msgctl and shmctl
36 * see also specific commands in sem.h, msg.h and shm.h
38 #define IPC_RMID 0 /* remove resource */
39 #define IPC_SET 1 /* set ipc_perm options */
40 #define IPC_STAT 2 /* get ipc_perm options */
41 #define IPC_INFO 3 /* see ipcs */
44 * Version flags for semctl, msgctl, and shmctl commands
45 * These are passed as bitflags or-ed with the actual command
47 #define IPC_OLD 0 /* Old version (no 32-bit UID support on many
49 #define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
50 message sizes, etc. */
54 #include <linux/kref.h>
56 #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
58 /* used by in-kernel data structures */
74 struct ipc_namespace
{
76 struct ipc_ids
*ids
[3];
91 extern struct ipc_namespace init_ipc_ns
;
94 #define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
95 extern struct ipc_namespace
*copy_ipcs(unsigned long flags
,
96 struct ipc_namespace
*ns
);
98 #define INIT_IPC_NS(ns)
99 static inline struct ipc_namespace
*copy_ipcs(unsigned long flags
,
100 struct ipc_namespace
*ns
)
107 extern void free_ipc_ns(struct kref
*kref
);
110 static inline struct ipc_namespace
*get_ipc_ns(struct ipc_namespace
*ns
)
119 static inline void put_ipc_ns(struct ipc_namespace
*ns
)
122 kref_put(&ns
->kref
, free_ipc_ns
);
126 #endif /* __KERNEL__ */
128 #endif /* _LINUX_IPC_H */