ipc.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. #ifdef __KERNEL__
  43. #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
  44. /* used by in-kernel data structures */
  45. struct kern_ipc_perm
  46. {
  47. spinlock_t lock;
  48. int deleted;
  49. key_t key;
  50. uid_t uid;
  51. gid_t gid;
  52. uid_t cuid;
  53. gid_t cgid;
  54. mode_t mode;
  55. unsigned long seq;
  56. void *security;
  57. };
  58. #endif /* __KERNEL__ */
  59. #endif /* _LINUX_IPC_H */