1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux << 2 #ifndef _UAPI_LINUX_IPC_H 1 #ifndef _UAPI_LINUX_IPC_H 3 #define _UAPI_LINUX_IPC_H 2 #define _UAPI_LINUX_IPC_H 4 3 5 #include <linux/types.h> 4 #include <linux/types.h> 6 5 7 #define IPC_PRIVATE ((__kernel_key_t) 0) 6 #define IPC_PRIVATE ((__kernel_key_t) 0) 8 7 9 /* Obsolete, used only for backwards compatibi 8 /* Obsolete, used only for backwards compatibility and libc5 compiles */ 10 struct ipc_perm 9 struct ipc_perm 11 { 10 { 12 __kernel_key_t key; 11 __kernel_key_t key; 13 __kernel_uid_t uid; 12 __kernel_uid_t uid; 14 __kernel_gid_t gid; 13 __kernel_gid_t gid; 15 __kernel_uid_t cuid; 14 __kernel_uid_t cuid; 16 __kernel_gid_t cgid; 15 __kernel_gid_t cgid; 17 __kernel_mode_t mode; 16 __kernel_mode_t mode; 18 unsigned short seq; 17 unsigned short seq; 19 }; 18 }; 20 19 21 /* Include the definition of ipc64_perm */ 20 /* Include the definition of ipc64_perm */ 22 #include <asm/ipcbuf.h> 21 #include <asm/ipcbuf.h> 23 22 24 /* resource get request flags */ 23 /* resource get request flags */ 25 #define IPC_CREAT 00001000 /* create if key 24 #define IPC_CREAT 00001000 /* create if key is nonexistent */ 26 #define IPC_EXCL 00002000 /* fail if key e 25 #define IPC_EXCL 00002000 /* fail if key exists */ 27 #define IPC_NOWAIT 00004000 /* return error 26 #define IPC_NOWAIT 00004000 /* return error on wait */ 28 27 29 /* these fields are used by the DIPC package s 28 /* these fields are used by the DIPC package so the kernel as standard 30 should avoid using them if possible */ 29 should avoid using them if possible */ 31 30 32 #define IPC_DIPC 00010000 /* make it distribu 31 #define IPC_DIPC 00010000 /* make it distributed */ 33 #define IPC_OWN 00020000 /* this machine is 32 #define IPC_OWN 00020000 /* this machine is the DIPC owner */ 34 33 35 /* 34 /* 36 * Control commands used with semctl, msgctl a 35 * Control commands used with semctl, msgctl and shmctl 37 * see also specific commands in sem.h, msg.h 36 * see also specific commands in sem.h, msg.h and shm.h 38 */ 37 */ 39 #define IPC_RMID 0 /* remove resource */ 38 #define IPC_RMID 0 /* remove resource */ 40 #define IPC_SET 1 /* set ipc_perm options 39 #define IPC_SET 1 /* set ipc_perm options */ 41 #define IPC_STAT 2 /* get ipc_perm options 40 #define IPC_STAT 2 /* get ipc_perm options */ 42 #define IPC_INFO 3 /* see ipcs */ 41 #define IPC_INFO 3 /* see ipcs */ 43 42 44 /* 43 /* 45 * Version flags for semctl, msgctl, and shmct 44 * Version flags for semctl, msgctl, and shmctl commands 46 * These are passed as bitflags or-ed with the 45 * These are passed as bitflags or-ed with the actual command 47 */ 46 */ 48 #define IPC_OLD 0 /* Old version (no 32- 47 #define IPC_OLD 0 /* Old version (no 32-bit UID support on many 49 architectures) */ 48 architectures) */ 50 #define IPC_64 0x0100 /* New version (suppor 49 #define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger 51 message sizes, etc. 50 message sizes, etc. */ 52 51 53 /* 52 /* 54 * These are used to wrap system calls. 53 * These are used to wrap system calls. 55 * 54 * 56 * See architecture code for ugly details.. 55 * See architecture code for ugly details.. 57 */ 56 */ 58 struct ipc_kludge { 57 struct ipc_kludge { 59 struct msgbuf __user *msgp; 58 struct msgbuf __user *msgp; 60 long msgtyp; 59 long msgtyp; 61 }; 60 }; 62 61 63 #define SEMOP 1 62 #define SEMOP 1 64 #define SEMGET 2 63 #define SEMGET 2 65 #define SEMCTL 3 64 #define SEMCTL 3 66 #define SEMTIMEDOP 4 65 #define SEMTIMEDOP 4 67 #define MSGSND 11 66 #define MSGSND 11 68 #define MSGRCV 12 67 #define MSGRCV 12 69 #define MSGGET 13 68 #define MSGGET 13 70 #define MSGCTL 14 69 #define MSGCTL 14 71 #define SHMAT 21 70 #define SHMAT 21 72 #define SHMDT 22 71 #define SHMDT 22 73 #define SHMGET 23 72 #define SHMGET 23 74 #define SHMCTL 24 73 #define SHMCTL 24 75 74 76 /* Used by the DIPC package, try and avoid reu 75 /* Used by the DIPC package, try and avoid reusing it */ 77 #define DIPC 25 76 #define DIPC 25 78 77 79 #define IPCCALL(version,op) ((version)<<16 78 #define IPCCALL(version,op) ((version)<<16 | (op)) 80 79 81 80 82 #endif /* _UAPI_LINUX_IPC_H */ 81 #endif /* _UAPI_LINUX_IPC_H */ 83 82
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.