shmbuf.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __ASM_GENERIC_SHMBUF_H
  3. #define __ASM_GENERIC_SHMBUF_H
  4. #include <asm/bitsperlong.h>
  5. /*
  6. * The shmid64_ds structure for x86 architecture.
  7. * Note extra padding because this structure is passed back and forth
  8. * between kernel and user space.
  9. *
  10. * shmid64_ds was originally meant to be architecture specific, but
  11. * everyone just ended up making identical copies without specific
  12. * optimizations, so we may just as well all use the same one.
  13. *
  14. * 64 bit architectures typically define a 64 bit __kernel_time_t,
  15. * so they do not need the first two padding words.
  16. * On big-endian systems, the padding is in the wrong place.
  17. *
  18. *
  19. * Pad space is left for:
  20. * - 2 miscellaneous 32-bit values
  21. */
  22. struct shmid64_ds {
  23. struct ipc64_perm shm_perm; /* operation perms */
  24. size_t shm_segsz; /* size of segment (bytes) */
  25. #if __BITS_PER_LONG == 64
  26. __kernel_time_t shm_atime; /* last attach time */
  27. __kernel_time_t shm_dtime; /* last detach time */
  28. __kernel_time_t shm_ctime; /* last change time */
  29. #else
  30. unsigned long shm_atime; /* last attach time */
  31. unsigned long shm_atime_high;
  32. unsigned long shm_dtime; /* last detach time */
  33. unsigned long shm_dtime_high;
  34. unsigned long shm_ctime; /* last change time */
  35. unsigned long shm_ctime_high;
  36. #endif
  37. __kernel_pid_t shm_cpid; /* pid of creator */
  38. __kernel_pid_t shm_lpid; /* pid of last operator */
  39. unsigned long shm_nattch; /* no. of current attaches */
  40. unsigned long __unused4;
  41. unsigned long __unused5;
  42. };
  43. struct shminfo64 {
  44. unsigned long shmmax;
  45. unsigned long shmmin;
  46. unsigned long shmmni;
  47. unsigned long shmseg;
  48. unsigned long shmall;
  49. unsigned long __unused1;
  50. unsigned long __unused2;
  51. unsigned long __unused3;
  52. unsigned long __unused4;
  53. };
  54. #endif /* __ASM_GENERIC_SHMBUF_H */