shm.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef _SYS_SHM_H
  2. #define _SYS_SHM_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #define __NEED_time_t
  8. #define __NEED_size_t
  9. #define __NEED_pid_t
  10. #include <bits/alltypes.h>
  11. #include <sys/ipc.h>
  12. #ifdef _GNU_SOURCE
  13. #define __used_ids used_ids
  14. #define __swap_attempts swap_attempts
  15. #define __swap_successes swap_successes
  16. #endif
  17. #include <bits/shm.h>
  18. #define SHM_R 0400
  19. #define SHM_W 0200
  20. #define SHM_RDONLY 010000
  21. #define SHM_RND 020000
  22. #define SHM_REMAP 040000
  23. #define SHM_EXEC 0100000
  24. #define SHM_LOCK 11
  25. #define SHM_UNLOCK 12
  26. #define SHM_STAT (13 | (IPC_STAT & 0x100))
  27. #define SHM_INFO 14
  28. #define SHM_STAT_ANY (15 | (IPC_STAT & 0x100))
  29. #define SHM_DEST 01000
  30. #define SHM_LOCKED 02000
  31. #define SHM_HUGETLB 04000
  32. #define SHM_NORESERVE 010000
  33. #define SHM_HUGE_SHIFT 26
  34. #define SHM_HUGE_MASK 0x3f
  35. #define SHM_HUGE_64KB (16 << 26)
  36. #define SHM_HUGE_512KB (19 << 26)
  37. #define SHM_HUGE_1MB (20 << 26)
  38. #define SHM_HUGE_2MB (21 << 26)
  39. #define SHM_HUGE_8MB (23 << 26)
  40. #define SHM_HUGE_16MB (24 << 26)
  41. #define SHM_HUGE_32MB (25 << 26)
  42. #define SHM_HUGE_256MB (28 << 26)
  43. #define SHM_HUGE_512MB (29 << 26)
  44. #define SHM_HUGE_1GB (30 << 26)
  45. #define SHM_HUGE_2GB (31 << 26)
  46. #define SHM_HUGE_16GB (34U << 26)
  47. typedef unsigned long shmatt_t;
  48. void *shmat(int, const void *, int);
  49. int shmctl(int, int, struct shmid_ds *);
  50. int shmdt(const void *);
  51. int shmget(key_t, size_t, int);
  52. #ifdef __cplusplus
  53. }
  54. #endif
  55. #endif