siginfo-consts.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /* siginfo constants. Linux version.
  2. Copyright (C) 1997-2026 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifndef _BITS_SIGINFO_CONSTS_H
  16. #define _BITS_SIGINFO_CONSTS_H 1
  17. #ifndef _SIGNAL_H
  18. #error "Don't include <bits/siginfo-consts.h> directly; use <signal.h> instead."
  19. #endif
  20. /* Most of these constants are uniform across all architectures, but there
  21. is one exception. */
  22. #include <bits/siginfo-arch.h>
  23. #ifndef __SI_ASYNCIO_AFTER_SIGIO
  24. # define __SI_ASYNCIO_AFTER_SIGIO 1
  25. #endif
  26. /* Values for `si_code'. Positive values are reserved for kernel-generated
  27. signals. */
  28. enum
  29. {
  30. SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
  31. SI_DETHREAD = -7, /* Sent by execve killing subsidiary
  32. threads. */
  33. SI_TKILL, /* Sent by tkill. */
  34. SI_SIGIO, /* Sent by queued SIGIO. */
  35. #if __SI_ASYNCIO_AFTER_SIGIO
  36. SI_ASYNCIO, /* Sent by AIO completion. */
  37. SI_MESGQ, /* Sent by real time mesq state change. */
  38. SI_TIMER, /* Sent by timer expiration. */
  39. #else
  40. SI_MESGQ,
  41. SI_TIMER,
  42. SI_ASYNCIO,
  43. #endif
  44. SI_QUEUE, /* Sent by sigqueue. */
  45. SI_USER, /* Sent by kill, sigsend. */
  46. SI_KERNEL = 0x80 /* Send by kernel. */
  47. #define SI_ASYNCNL SI_ASYNCNL
  48. #define SI_DETHREAD SI_DETHREAD
  49. #define SI_TKILL SI_TKILL
  50. #define SI_SIGIO SI_SIGIO
  51. #define SI_ASYNCIO SI_ASYNCIO
  52. #define SI_MESGQ SI_MESGQ
  53. #define SI_TIMER SI_TIMER
  54. #define SI_ASYNCIO SI_ASYNCIO
  55. #define SI_QUEUE SI_QUEUE
  56. #define SI_USER SI_USER
  57. #define SI_KERNEL SI_KERNEL
  58. };
  59. # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
  60. /* `si_code' values for SIGILL signal. */
  61. enum
  62. {
  63. ILL_ILLOPC = 1, /* Illegal opcode. */
  64. # define ILL_ILLOPC ILL_ILLOPC
  65. ILL_ILLOPN, /* Illegal operand. */
  66. # define ILL_ILLOPN ILL_ILLOPN
  67. ILL_ILLADR, /* Illegal addressing mode. */
  68. # define ILL_ILLADR ILL_ILLADR
  69. ILL_ILLTRP, /* Illegal trap. */
  70. # define ILL_ILLTRP ILL_ILLTRP
  71. ILL_PRVOPC, /* Privileged opcode. */
  72. # define ILL_PRVOPC ILL_PRVOPC
  73. ILL_PRVREG, /* Privileged register. */
  74. # define ILL_PRVREG ILL_PRVREG
  75. ILL_COPROC, /* Coprocessor error. */
  76. # define ILL_COPROC ILL_COPROC
  77. ILL_BADSTK, /* Internal stack error. */
  78. # define ILL_BADSTK ILL_BADSTK
  79. ILL_BADIADDR /* Unimplemented instruction address. */
  80. # define ILL_BADIADDR ILL_BADIADDR
  81. };
  82. /* `si_code' values for SIGFPE signal. */
  83. enum
  84. {
  85. FPE_INTDIV = 1, /* Integer divide by zero. */
  86. # define FPE_INTDIV FPE_INTDIV
  87. FPE_INTOVF, /* Integer overflow. */
  88. # define FPE_INTOVF FPE_INTOVF
  89. FPE_FLTDIV, /* Floating point divide by zero. */
  90. # define FPE_FLTDIV FPE_FLTDIV
  91. FPE_FLTOVF, /* Floating point overflow. */
  92. # define FPE_FLTOVF FPE_FLTOVF
  93. FPE_FLTUND, /* Floating point underflow. */
  94. # define FPE_FLTUND FPE_FLTUND
  95. FPE_FLTRES, /* Floating point inexact result. */
  96. # define FPE_FLTRES FPE_FLTRES
  97. FPE_FLTINV, /* Floating point invalid operation. */
  98. # define FPE_FLTINV FPE_FLTINV
  99. FPE_FLTSUB, /* Subscript out of range. */
  100. # define FPE_FLTSUB FPE_FLTSUB
  101. FPE_FLTUNK = 14, /* Undiagnosed floating-point exception. */
  102. # define FPE_FLTUNK FPE_FLTUNK
  103. FPE_CONDTRAP /* Trap on condition. */
  104. # define FPE_CONDTRAP FPE_CONDTRAP
  105. };
  106. /* `si_code' values for SIGSEGV signal. */
  107. enum
  108. {
  109. SEGV_MAPERR = 1, /* Address not mapped to object. */
  110. # define SEGV_MAPERR SEGV_MAPERR
  111. SEGV_ACCERR, /* Invalid permissions for mapped object. */
  112. # define SEGV_ACCERR SEGV_ACCERR
  113. SEGV_BNDERR, /* Bounds checking failure. */
  114. # define SEGV_BNDERR SEGV_BNDERR
  115. SEGV_PKUERR, /* Protection key checking failure. */
  116. # define SEGV_PKUERR SEGV_PKUERR
  117. SEGV_ACCADI, /* ADI not enabled for mapped object. */
  118. # define SEGV_ACCADI SEGV_ACCADI
  119. SEGV_ADIDERR, /* Disrupting MCD error. */
  120. # define SEGV_ADIDERR SEGV_ADIDERR
  121. SEGV_ADIPERR, /* Precise MCD exception. */
  122. # define SEGV_ADIPERR SEGV_ADIPERR
  123. SEGV_MTEAERR, /* Asynchronous ARM MTE error. */
  124. # define SEGV_MTEAERR SEGV_MTEAERR
  125. SEGV_MTESERR, /* Synchronous ARM MTE exception. */
  126. # define SEGV_MTESERR SEGV_MTESERR
  127. SEGV_CPERR /* Control protection fault. */
  128. # define SEGV_CPERR SEGV_CPERR
  129. };
  130. /* `si_code' values for SIGBUS signal. */
  131. enum
  132. {
  133. BUS_ADRALN = 1, /* Invalid address alignment. */
  134. # define BUS_ADRALN BUS_ADRALN
  135. BUS_ADRERR, /* Non-existent physical address. */
  136. # define BUS_ADRERR BUS_ADRERR
  137. BUS_OBJERR, /* Object specific hardware error. */
  138. # define BUS_OBJERR BUS_OBJERR
  139. BUS_MCEERR_AR, /* Hardware memory error: action required. */
  140. # define BUS_MCEERR_AR BUS_MCEERR_AR
  141. BUS_MCEERR_AO /* Hardware memory error: action optional. */
  142. # define BUS_MCEERR_AO BUS_MCEERR_AO
  143. };
  144. # endif
  145. # ifdef __USE_XOPEN_EXTENDED
  146. /* `si_code' values for SIGTRAP signal. */
  147. enum
  148. {
  149. TRAP_BRKPT = 1, /* Process breakpoint. */
  150. # define TRAP_BRKPT TRAP_BRKPT
  151. TRAP_TRACE, /* Process trace trap. */
  152. # define TRAP_TRACE TRAP_TRACE
  153. TRAP_BRANCH, /* Process taken branch trap. */
  154. # define TRAP_BRANCH TRAP_BRANCH
  155. TRAP_HWBKPT, /* Hardware breakpoint/watchpoint. */
  156. # define TRAP_HWBKPT TRAP_HWBKPT
  157. TRAP_UNK, /* Undiagnosed trap. */
  158. # define TRAP_UNK TRAP_UNK
  159. TRAP_PERF /* Perf event with sigtrap=1. */
  160. # define TRAP_PERF TRAP_PERF
  161. };
  162. # endif
  163. # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
  164. /* `si_code' values for SIGCHLD signal. */
  165. enum
  166. {
  167. CLD_EXITED = 1, /* Child has exited. */
  168. # define CLD_EXITED CLD_EXITED
  169. CLD_KILLED, /* Child was killed. */
  170. # define CLD_KILLED CLD_KILLED
  171. CLD_DUMPED, /* Child terminated abnormally. */
  172. # define CLD_DUMPED CLD_DUMPED
  173. CLD_TRAPPED, /* Traced child has trapped. */
  174. # define CLD_TRAPPED CLD_TRAPPED
  175. CLD_STOPPED, /* Child has stopped. */
  176. # define CLD_STOPPED CLD_STOPPED
  177. CLD_CONTINUED /* Stopped child has continued. */
  178. # define CLD_CONTINUED CLD_CONTINUED
  179. };
  180. /* `si_code' values for SIGPOLL signal. */
  181. enum
  182. {
  183. POLL_IN = 1, /* Data input available. */
  184. # define POLL_IN POLL_IN
  185. POLL_OUT, /* Output buffers available. */
  186. # define POLL_OUT POLL_OUT
  187. POLL_MSG, /* Input message available. */
  188. # define POLL_MSG POLL_MSG
  189. POLL_ERR, /* I/O error. */
  190. # define POLL_ERR POLL_ERR
  191. POLL_PRI, /* High priority input available. */
  192. # define POLL_PRI POLL_PRI
  193. POLL_HUP /* Device disconnected. */
  194. # define POLL_HUP POLL_HUP
  195. };
  196. # endif
  197. /* The Linux-specific SIGSYS values are all considered GNU extensions. */
  198. #ifdef __USE_GNU
  199. /* `si_code' values for SIGSYS signal. */
  200. enum
  201. {
  202. SYS_SECCOMP = 1, /* Seccomp triggered. */
  203. # define SYS_SECCOMP SYS_SECCOMP
  204. SYS_USER_DISPATCH /* Syscall user dispatch triggered. */
  205. # define SYS_USER_DISPATCH SYS_USER_DISPATCH
  206. };
  207. #endif
  208. /* Architectures might also add architecture-specific constants.
  209. These are all considered GNU extensions. */
  210. #ifdef __USE_GNU
  211. # include <bits/siginfo-consts-arch.h>
  212. #endif
  213. #endif