83 lines · c
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */2#ifndef _UAPI_LINUX_IPC_H3#define _UAPI_LINUX_IPC_H4 5#include <linux/types.h>6 7#define IPC_PRIVATE ((__kernel_key_t) 0) 8 9/* Obsolete, used only for backwards compatibility and libc5 compiles */10struct ipc_perm11{12 __kernel_key_t key;13 __kernel_uid_t uid;14 __kernel_gid_t gid;15 __kernel_uid_t cuid;16 __kernel_gid_t cgid;17 __kernel_mode_t mode; 18 unsigned short seq;19};20 21/* Include the definition of ipc64_perm */22#include <asm/ipcbuf.h>23 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 */28 29/* these fields are used by the DIPC package so the kernel as standard30 should avoid using them if possible */31 32#define IPC_DIPC 00010000 /* make it distributed */33#define IPC_OWN 00020000 /* this machine is the DIPC owner */34 35/* 36 * Control commands used with semctl, msgctl and shmctl 37 * see also specific commands in sem.h, msg.h and shm.h38 */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 */43 44/*45 * Version flags for semctl, msgctl, and shmctl commands46 * These are passed as bitflags or-ed with the actual command47 */48#define IPC_OLD 0 /* Old version (no 32-bit UID support on many49 architectures) */50#define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger51 message sizes, etc. */52 53/*54 * These are used to wrap system calls.55 *56 * See architecture code for ugly details..57 */58struct ipc_kludge {59 struct msgbuf __user *msgp;60 long msgtyp;61};62 63#define SEMOP 164#define SEMGET 265#define SEMCTL 366#define SEMTIMEDOP 467#define MSGSND 1168#define MSGRCV 1269#define MSGGET 1370#define MSGCTL 1471#define SHMAT 2172#define SHMDT 2273#define SHMGET 2374#define SHMCTL 2475 76/* Used by the DIPC package, try and avoid reusing it */77#define DIPC 2578 79#define IPCCALL(version,op) ((version)<<16 | (op))80 81 82#endif /* _UAPI_LINUX_IPC_H */83