4 #include <linux/types.h>
5 #include <linux/kref.h>
7 #define IPC_PRIVATE ((__kernel_key_t) 0)
9 /* Obsolete, used only for backwards compatibility and libc5 compiles */
21 /* Include the definition of ipc64_perm */
22 #include <asm/ipcbuf.h>
24 /* resource get request flags */
25 #define IPC_CREAT 00001000 /* create if key is nonexistent */
26 #define IPC_EXCL 00002000 /* fail if key exists */
27 #define IPC_NOWAIT 00004000 /* return error on wait */
29 /* these fields are used by the DIPC package so the kernel as standard
30 should avoid using them if possible */
32 #define IPC_DIPC 00010000 /* make it distributed */
33 #define IPC_OWN 00020000 /* this machine is the DIPC owner */
36 * Control commands used with semctl, msgctl and shmctl
37 * see also specific commands in sem.h, msg.h and shm.h
39 #define IPC_RMID 0 /* remove resource */
40 #define IPC_SET 1 /* set ipc_perm options */
41 #define IPC_STAT 2 /* get ipc_perm options */
42 #define IPC_INFO 3 /* see ipcs */
45 * Version flags for semctl, msgctl, and shmctl commands
46 * These are passed as bitflags or-ed with the actual command
48 #define IPC_OLD 0 /* Old version (no 32-bit UID support on many
50 #define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
51 message sizes, etc. */
55 #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
57 /* used by in-kernel data structures */
73 struct ipc_namespace {
75 struct ipc_ids *ids[3];
90 extern struct ipc_namespace init_ipc_ns;
93 #define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
95 #define INIT_IPC_NS(ns)
99 extern void free_ipc_ns(struct kref *kref);
100 extern int copy_ipcs(unsigned long flags, struct task_struct *tsk);
101 extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns);
103 static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk)
109 static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
118 static inline void put_ipc_ns(struct ipc_namespace *ns)
121 kref_put(&ns->kref, free_ipc_ns);
125 #endif /* __KERNEL__ */
127 #endif /* _LINUX_IPC_H */