Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPI_LINUX_IPC_H
0003 #define _UAPI_LINUX_IPC_H
0004 
0005 #include <linux/types.h>
0006 
0007 #define IPC_PRIVATE ((__kernel_key_t) 0)  
0008 
0009 /* Obsolete, used only for backwards compatibility and libc5 compiles */
0010 struct ipc_perm
0011 {
0012     __kernel_key_t  key;
0013     __kernel_uid_t  uid;
0014     __kernel_gid_t  gid;
0015     __kernel_uid_t  cuid;
0016     __kernel_gid_t  cgid;
0017     __kernel_mode_t mode; 
0018     unsigned short  seq;
0019 };
0020 
0021 /* Include the definition of ipc64_perm */
0022 #include <asm/ipcbuf.h>
0023 
0024 /* resource get request flags */
0025 #define IPC_CREAT  00001000   /* create if key is nonexistent */
0026 #define IPC_EXCL   00002000   /* fail if key exists */
0027 #define IPC_NOWAIT 00004000   /* return error on wait */
0028 
0029 /* these fields are used by the DIPC package so the kernel as standard
0030    should avoid using them if possible */
0031    
0032 #define IPC_DIPC 00010000  /* make it distributed */
0033 #define IPC_OWN  00020000  /* this machine is the DIPC owner */
0034 
0035 /* 
0036  * Control commands used with semctl, msgctl and shmctl 
0037  * see also specific commands in sem.h, msg.h and shm.h
0038  */
0039 #define IPC_RMID 0     /* remove resource */
0040 #define IPC_SET  1     /* set ipc_perm options */
0041 #define IPC_STAT 2     /* get ipc_perm options */
0042 #define IPC_INFO 3     /* see ipcs */
0043 
0044 /*
0045  * Version flags for semctl, msgctl, and shmctl commands
0046  * These are passed as bitflags or-ed with the actual command
0047  */
0048 #define IPC_OLD 0   /* Old version (no 32-bit UID support on many
0049                architectures) */
0050 #define IPC_64  0x0100  /* New version (support 32-bit UIDs, bigger
0051                message sizes, etc. */
0052 
0053 /*
0054  * These are used to wrap system calls.
0055  *
0056  * See architecture code for ugly details..
0057  */
0058 struct ipc_kludge {
0059     struct msgbuf __user *msgp;
0060     long msgtyp;
0061 };
0062 
0063 #define SEMOP        1
0064 #define SEMGET       2
0065 #define SEMCTL       3
0066 #define SEMTIMEDOP   4
0067 #define MSGSND      11
0068 #define MSGRCV      12
0069 #define MSGGET      13
0070 #define MSGCTL      14
0071 #define SHMAT       21
0072 #define SHMDT       22
0073 #define SHMGET      23
0074 #define SHMCTL      24
0075 
0076 /* Used by the DIPC package, try and avoid reusing it */
0077 #define DIPC            25
0078 
0079 #define IPCCALL(version,op) ((version)<<16 | (op))
0080 
0081 
0082 #endif /* _UAPI_LINUX_IPC_H */