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