Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ipc_defs.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (c) 2003 Roland McGrath <roland@redhat.com>
  3. * Copyright (c) 2003-2020 The strace developers.
  4. * All rights reserved.
  5. *
  6. * SPDX-License-Identifier: LGPL-2.1-or-later
  7. */
  8. #ifndef STRACE_IPC_DEFS_H
  9. # define STRACE_IPC_DEFS_H
  10. # ifdef HAVE_LINUX_IPC_H
  11. # if defined MPERS_IS_m32
  12. # if defined ARCH_M32_SIZEOF_STRUCT_MSQID64_DS && \
  13. defined M32_SIZEOF_STRUCT_MSQID64_DS && \
  14. ARCH_M32_SIZEOF_STRUCT_MSQID64_DS != M32_SIZEOF_STRUCT_MSQID64_DS
  15. # undef HAVE_LINUX_IPC_H
  16. # endif
  17. # elif defined MPERS_IS_mx32
  18. # if defined ARCH_MX32_SIZEOF_STRUCT_MSQID64_DS && \
  19. defined MX32_SIZEOF_STRUCT_MSQID64_DS && \
  20. ARCH_MX32_SIZEOF_STRUCT_MSQID64_DS != MX32_SIZEOF_STRUCT_MSQID64_DS
  21. # undef HAVE_LINUX_IPC_H
  22. # endif
  23. # else /* !IN_MPERS */
  24. # if defined ARCH_SIZEOF_STRUCT_MSQID64_DS && \
  25. defined SIZEOF_STRUCT_MSQID64_DS && \
  26. ARCH_SIZEOF_STRUCT_MSQID64_DS != SIZEOF_STRUCT_MSQID64_DS
  27. # undef HAVE_LINUX_IPC_H
  28. # endif
  29. # endif
  30. # endif /* HAVE_LINUX_IPC_H */
  31. # if defined HAVE_LINUX_IPC_H
  32. # include <linux/ipc.h>
  33. # define MSG_H_PROVIDER "linux/msg.h"
  34. # define SEM_H_PROVIDER "linux/sem.h"
  35. # define SHM_H_PROVIDER "linux/shm.h"
  36. # define NAME_OF_STRUCT_MSQID_DS msqid64_ds
  37. # define NAME_OF_STRUCT_SHMID_DS shmid64_ds
  38. # define NAME_OF_STRUCT_IPC_PERM_KEY key
  39. # elif defined HAVE_SYS_IPC_H
  40. # include <sys/ipc.h>
  41. # define MSG_H_PROVIDER "sys/msg.h"
  42. # define SEM_H_PROVIDER "sys/sem.h"
  43. # define SHM_H_PROVIDER "sys/shm.h"
  44. # define NAME_OF_STRUCT_MSQID_DS msqid_ds
  45. # define NAME_OF_STRUCT_SHMID_DS shmid_ds
  46. # define NAME_OF_STRUCT_IPC_PERM_KEY __key
  47. # else
  48. # error Neither <sys/ipc.h> nor <linux/ipc.h> is available
  49. # endif
  50. # if !defined IPC_64
  51. # define IPC_64 0x100
  52. # endif
  53. # define PRINTCTL(flagset, arg, dflt) \
  54. do { \
  55. if ((arg) & IPC_64) { \
  56. print_xlat(IPC_64); \
  57. tprints("|"); \
  58. } \
  59. printxval((flagset), (arg) & ~IPC_64, dflt); \
  60. } while (0)
  61. #endif /* !STRACE_IPC_DEFS_H */