ipc.h 2.1 KB

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