xref: /openbmc/linux/include/uapi/linux/ipc.h (revision 607ca46e)
1607ca46eSDavid Howells #ifndef _UAPI_LINUX_IPC_H
2607ca46eSDavid Howells #define _UAPI_LINUX_IPC_H
3607ca46eSDavid Howells 
4607ca46eSDavid Howells #include <linux/types.h>
5607ca46eSDavid Howells 
6607ca46eSDavid Howells #define IPC_PRIVATE ((__kernel_key_t) 0)
7607ca46eSDavid Howells 
8607ca46eSDavid Howells /* Obsolete, used only for backwards compatibility and libc5 compiles */
9607ca46eSDavid Howells struct ipc_perm
10607ca46eSDavid Howells {
11607ca46eSDavid Howells 	__kernel_key_t	key;
12607ca46eSDavid Howells 	__kernel_uid_t	uid;
13607ca46eSDavid Howells 	__kernel_gid_t	gid;
14607ca46eSDavid Howells 	__kernel_uid_t	cuid;
15607ca46eSDavid Howells 	__kernel_gid_t	cgid;
16607ca46eSDavid Howells 	__kernel_mode_t	mode;
17607ca46eSDavid Howells 	unsigned short	seq;
18607ca46eSDavid Howells };
19607ca46eSDavid Howells 
20607ca46eSDavid Howells /* Include the definition of ipc64_perm */
21607ca46eSDavid Howells #include <asm/ipcbuf.h>
22607ca46eSDavid Howells 
23607ca46eSDavid Howells /* resource get request flags */
24607ca46eSDavid Howells #define IPC_CREAT  00001000   /* create if key is nonexistent */
25607ca46eSDavid Howells #define IPC_EXCL   00002000   /* fail if key exists */
26607ca46eSDavid Howells #define IPC_NOWAIT 00004000   /* return error on wait */
27607ca46eSDavid Howells 
28607ca46eSDavid Howells /* these fields are used by the DIPC package so the kernel as standard
29607ca46eSDavid Howells    should avoid using them if possible */
30607ca46eSDavid Howells 
31607ca46eSDavid Howells #define IPC_DIPC 00010000  /* make it distributed */
32607ca46eSDavid Howells #define IPC_OWN  00020000  /* this machine is the DIPC owner */
33607ca46eSDavid Howells 
34607ca46eSDavid Howells /*
35607ca46eSDavid Howells  * Control commands used with semctl, msgctl and shmctl
36607ca46eSDavid Howells  * see also specific commands in sem.h, msg.h and shm.h
37607ca46eSDavid Howells  */
38607ca46eSDavid Howells #define IPC_RMID 0     /* remove resource */
39607ca46eSDavid Howells #define IPC_SET  1     /* set ipc_perm options */
40607ca46eSDavid Howells #define IPC_STAT 2     /* get ipc_perm options */
41607ca46eSDavid Howells #define IPC_INFO 3     /* see ipcs */
42607ca46eSDavid Howells 
43607ca46eSDavid Howells /*
44607ca46eSDavid Howells  * Version flags for semctl, msgctl, and shmctl commands
45607ca46eSDavid Howells  * These are passed as bitflags or-ed with the actual command
46607ca46eSDavid Howells  */
47607ca46eSDavid Howells #define IPC_OLD 0	/* Old version (no 32-bit UID support on many
48607ca46eSDavid Howells 			   architectures) */
49607ca46eSDavid Howells #define IPC_64  0x0100  /* New version (support 32-bit UIDs, bigger
50607ca46eSDavid Howells 			   message sizes, etc. */
51607ca46eSDavid Howells 
52607ca46eSDavid Howells /*
53607ca46eSDavid Howells  * These are used to wrap system calls.
54607ca46eSDavid Howells  *
55607ca46eSDavid Howells  * See architecture code for ugly details..
56607ca46eSDavid Howells  */
57607ca46eSDavid Howells struct ipc_kludge {
58607ca46eSDavid Howells 	struct msgbuf __user *msgp;
59607ca46eSDavid Howells 	long msgtyp;
60607ca46eSDavid Howells };
61607ca46eSDavid Howells 
62607ca46eSDavid Howells #define SEMOP		 1
63607ca46eSDavid Howells #define SEMGET		 2
64607ca46eSDavid Howells #define SEMCTL		 3
65607ca46eSDavid Howells #define SEMTIMEDOP	 4
66607ca46eSDavid Howells #define MSGSND		11
67607ca46eSDavid Howells #define MSGRCV		12
68607ca46eSDavid Howells #define MSGGET		13
69607ca46eSDavid Howells #define MSGCTL		14
70607ca46eSDavid Howells #define SHMAT		21
71607ca46eSDavid Howells #define SHMDT		22
72607ca46eSDavid Howells #define SHMGET		23
73607ca46eSDavid Howells #define SHMCTL		24
74607ca46eSDavid Howells 
75607ca46eSDavid Howells /* Used by the DIPC package, try and avoid reusing it */
76607ca46eSDavid Howells #define DIPC            25
77607ca46eSDavid Howells 
78607ca46eSDavid Howells #define IPCCALL(version,op)	((version)<<16 | (op))
79607ca46eSDavid Howells 
80607ca46eSDavid Howells 
81607ca46eSDavid Howells #endif /* _UAPI_LINUX_IPC_H */
82