ipc.h 2.0 KB

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