shmbuf.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _ASM_SHMBUF_H
  3. #define _ASM_SHMBUF_H
  4. /*
  5. * The shmid64_ds structure for the MIPS architecture.
  6. * Note extra padding because this structure is passed back and forth
  7. * between kernel and user space.
  8. *
  9. * As MIPS was lacking proper padding after shm_?time, we use 48 bits
  10. * of the padding at the end to store a few additional bits of the time.
  11. * libc implementations need to take care to convert this into a proper
  12. * data structure when moving to 64-bit time_t.
  13. */
  14. #ifdef __mips64
  15. struct shmid64_ds {
  16. struct ipc64_perm shm_perm; /* operation perms */
  17. size_t shm_segsz; /* size of segment (bytes) */
  18. __kernel_time_t shm_atime; /* last attach time */
  19. __kernel_time_t shm_dtime; /* last detach time */
  20. __kernel_time_t shm_ctime; /* last change time */
  21. __kernel_pid_t shm_cpid; /* pid of creator */
  22. __kernel_pid_t shm_lpid; /* pid of last operator */
  23. unsigned long shm_nattch; /* no. of current attaches */
  24. unsigned long __unused1;
  25. unsigned long __unused2;
  26. };
  27. #else
  28. struct shmid64_ds {
  29. struct ipc64_perm shm_perm; /* operation perms */
  30. size_t shm_segsz; /* size of segment (bytes) */
  31. unsigned long shm_atime; /* last attach time */
  32. unsigned long shm_dtime; /* last detach time */
  33. unsigned long shm_ctime; /* last change time */
  34. __kernel_pid_t shm_cpid; /* pid of creator */
  35. __kernel_pid_t shm_lpid; /* pid of last operator */
  36. unsigned long shm_nattch; /* no. of current attaches */
  37. unsigned short shm_atime_high;
  38. unsigned short shm_dtime_high;
  39. unsigned short shm_ctime_high;
  40. unsigned short __unused1;
  41. };
  42. #endif
  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_SHMBUF_H */