siginfo-consts.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /* siginfo constants. Linux version.
  2. Copyright (C) 1997-2021 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. };
  128. /* `si_code' values for SIGBUS signal. */
  129. enum
  130. {
  131. BUS_ADRALN = 1, /* Invalid address alignment. */
  132. # define BUS_ADRALN BUS_ADRALN
  133. BUS_ADRERR, /* Non-existant physical address. */
  134. # define BUS_ADRERR BUS_ADRERR
  135. BUS_OBJERR, /* Object specific hardware error. */
  136. # define BUS_OBJERR BUS_OBJERR
  137. BUS_MCEERR_AR, /* Hardware memory error: action required. */
  138. # define BUS_MCEERR_AR BUS_MCEERR_AR
  139. BUS_MCEERR_AO /* Hardware memory error: action optional. */
  140. # define BUS_MCEERR_AO BUS_MCEERR_AO
  141. };
  142. # endif
  143. # ifdef __USE_XOPEN_EXTENDED
  144. /* `si_code' values for SIGTRAP signal. */
  145. enum
  146. {
  147. TRAP_BRKPT = 1, /* Process breakpoint. */
  148. # define TRAP_BRKPT TRAP_BRKPT
  149. TRAP_TRACE, /* Process trace trap. */
  150. # define TRAP_TRACE TRAP_TRACE
  151. TRAP_BRANCH, /* Process taken branch trap. */
  152. # define TRAP_BRANCH TRAP_BRANCH
  153. TRAP_HWBKPT, /* Hardware breakpoint/watchpoint. */
  154. # define TRAP_HWBKPT TRAP_HWBKPT
  155. TRAP_UNK /* Undiagnosed trap. */
  156. # define TRAP_UNK TRAP_UNK
  157. };
  158. # endif
  159. # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
  160. /* `si_code' values for SIGCHLD signal. */
  161. enum
  162. {
  163. CLD_EXITED = 1, /* Child has exited. */
  164. # define CLD_EXITED CLD_EXITED
  165. CLD_KILLED, /* Child was killed. */
  166. # define CLD_KILLED CLD_KILLED
  167. CLD_DUMPED, /* Child terminated abnormally. */
  168. # define CLD_DUMPED CLD_DUMPED
  169. CLD_TRAPPED, /* Traced child has trapped. */
  170. # define CLD_TRAPPED CLD_TRAPPED
  171. CLD_STOPPED, /* Child has stopped. */
  172. # define CLD_STOPPED CLD_STOPPED
  173. CLD_CONTINUED /* Stopped child has continued. */
  174. # define CLD_CONTINUED CLD_CONTINUED
  175. };
  176. /* `si_code' values for SIGPOLL signal. */
  177. enum
  178. {
  179. POLL_IN = 1, /* Data input available. */
  180. # define POLL_IN POLL_IN
  181. POLL_OUT, /* Output buffers available. */
  182. # define POLL_OUT POLL_OUT
  183. POLL_MSG, /* Input message available. */
  184. # define POLL_MSG POLL_MSG
  185. POLL_ERR, /* I/O error. */
  186. # define POLL_ERR POLL_ERR
  187. POLL_PRI, /* High priority input available. */
  188. # define POLL_PRI POLL_PRI
  189. POLL_HUP /* Device disconnected. */
  190. # define POLL_HUP POLL_HUP
  191. };
  192. # endif
  193. /* Architectures might also add architecture-specific constants.
  194. These are all considered GNU extensions. */
  195. #ifdef __USE_GNU
  196. # include <bits/siginfo-consts-arch.h>
  197. #endif
  198. #endif