]>
Commit | Line | Data |
---|---|---|
cbdee279 | 1 | /* siginfo_t, sigevent and constants. Stub version. |
d4697bc9 | 2 | Copyright (C) 1997-2014 Free Software Foundation, Inc. |
cbdee279 UD |
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 | |
41bdb6e2 AJ |
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. | |
cbdee279 UD |
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 | |
41bdb6e2 | 13 | Lesser General Public License for more details. |
cbdee279 | 14 | |
41bdb6e2 | 15 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
16 | License along with the GNU C Library; if not, see |
17 | <http://www.gnu.org/licenses/>. */ | |
cbdee279 | 18 | |
2ace5721 UD |
19 | #if !defined _SIGNAL_H && !defined __need_siginfo_t \ |
20 | && !defined __need_sigevent_t | |
cbdee279 UD |
21 | # error "Never include this file directly. Use <signal.h> instead" |
22 | #endif | |
23 | ||
2ace5721 UD |
24 | #if (!defined __have_sigval_t \ |
25 | && (defined _SIGNAL_H || defined __need_siginfo_t \ | |
26 | || defined __need_sigevent_t)) | |
27 | # define __have_sigval_t 1 | |
bd355af0 UD |
28 | |
29 | /* Type for data associated with a signal. */ | |
30 | typedef union sigval | |
31 | { | |
32 | int sival_int; | |
33 | void *sival_ptr; | |
34 | } sigval_t; | |
2ace5721 UD |
35 | #endif |
36 | ||
37 | #if (!defined __have_siginfo_t \ | |
38 | && (defined _SIGNAL_H || defined __need_siginfo_t)) | |
39 | # define __have_siginfo_t 1 | |
bd355af0 | 40 | |
cbdee279 UD |
41 | typedef struct siginfo |
42 | { | |
43 | int si_signo; /* Signal number. */ | |
44 | int si_errno; /* If non-zero, an errno value associated with | |
45 | this signal, as defined in <errno.h>. */ | |
46 | int si_code; /* Signal code. */ | |
47 | __pid_t si_pid; /* Sending process ID. */ | |
48 | __uid_t si_uid; /* Real user ID of sending process. */ | |
49 | void *si_addr; /* Address of faulting instruction. */ | |
50 | int si_status; /* Exit value or signal. */ | |
51 | long int si_band; /* Band event for SIGPOLL. */ | |
52 | union sigval si_value; /* Signal value. */ | |
53 | } siginfo_t; | |
54 | ||
55 | ||
56 | /* Values for `si_code'. Positive values are reserved for kernel-generated | |
57 | signals. */ | |
58 | enum | |
59 | { | |
60 | SI_ASYNCIO = -4, /* Sent by AIO completion. */ | |
bd355af0 | 61 | # define SI_ASYNCIO SI_ASYNCIO |
cbdee279 | 62 | SI_MESGQ, /* Sent by real time mesq state change. */ |
bd355af0 | 63 | # define SI_MESGQ SI_MESGQ |
cbdee279 | 64 | SI_TIMER, /* Sent by timer expiration. */ |
bd355af0 | 65 | # define SI_TIMER SI_TIMER |
cbdee279 | 66 | SI_QUEUE, /* Sent by sigqueue. */ |
bd355af0 | 67 | # define SI_QUEUE SI_QUEUE |
cbdee279 | 68 | SI_USER /* Sent by kill, sigsend, raise. */ |
bd355af0 | 69 | # define SI_USER SI_USER |
cbdee279 UD |
70 | }; |
71 | ||
72 | ||
73 | /* `si_code' values for SIGILL signal. */ | |
74 | enum | |
75 | { | |
76 | ILL_ILLOPC = 1, /* Illegal opcode. */ | |
bd355af0 | 77 | # define ILL_ILLOPC ILL_ILLOPC |
1f8f2b60 | 78 | ILL_ILLOPN, /* Illegal operand. */ |
bd355af0 | 79 | # define ILL_ILLOPN ILL_ILLOPN |
cbdee279 | 80 | ILL_ILLADR, /* Illegal addressing mode. */ |
bd355af0 | 81 | # define ILL_ILLADR ILL_ILLADR |
cbdee279 | 82 | ILL_ILLTRP, /* Illegal trap. */ |
bd355af0 | 83 | # define ILL_ILLTRP ILL_ILLTRP |
cbdee279 | 84 | ILL_PRVOPC, /* Privileged opcode. */ |
bd355af0 | 85 | # define ILL_PRVOPC ILL_PRVOPC |
cbdee279 | 86 | ILL_PRVREG, /* Privileged register. */ |
bd355af0 | 87 | # define ILL_PRVREG ILL_PRVREG |
cbdee279 | 88 | ILL_COPROC, /* Coprocessor error. */ |
bd355af0 | 89 | # define ILL_COPROC ILL_COPROC |
cbdee279 | 90 | ILL_BADSTK /* Internal stack error. */ |
bd355af0 | 91 | # define ILL_BADSTK ILL_BADSTK |
cbdee279 UD |
92 | }; |
93 | ||
94 | /* `si_code' values for SIGFPE signal. */ | |
95 | enum | |
96 | { | |
97 | FPE_INTDIV = 1, /* Integer divide by zero. */ | |
bd355af0 | 98 | # define FPE_INTDIV FPE_INTDIV |
cbdee279 | 99 | FPE_INTOVF, /* Integer overflow. */ |
bd355af0 | 100 | # define FPE_INTOVF FPE_INTOVF |
cbdee279 | 101 | FPE_FLTDIV, /* Floating point divide by zero. */ |
bd355af0 | 102 | # define FPE_FLTDIV FPE_FLTDIV |
cbdee279 | 103 | FPE_FLTOVF, /* Floating point overflow. */ |
bd355af0 | 104 | # define FPE_FLTOVF FPE_FLTOVF |
cbdee279 | 105 | FPE_FLTUND, /* Floating point underflow. */ |
bd355af0 | 106 | # define FPE_FLTUND FPE_FLTUND |
cbdee279 | 107 | FPE_FLTRES, /* Floating point inexact result. */ |
bd355af0 | 108 | # define FPE_FLTRES FPE_FLTRES |
cbdee279 | 109 | FPE_FLTINV, /* Floating point invalid operation. */ |
bd355af0 | 110 | # define FPE_FLTINV FPE_FLTINV |
cbdee279 | 111 | FPE_FLTSUB /* Subscript out of range. */ |
bd355af0 | 112 | # define FPE_FLTSUB FPE_FLTSUB |
cbdee279 UD |
113 | }; |
114 | ||
115 | /* `si_code' values for SIGSEGV signal. */ | |
116 | enum | |
117 | { | |
118 | SEGV_MAPERR = 1, /* Address not mapped to object. */ | |
bd355af0 | 119 | # define SEGV_MAPERR SEGV_MAPERR |
cbdee279 | 120 | SEGV_ACCERR /* Invalid permissions for mapped object. */ |
bd355af0 | 121 | # define SEGV_ACCERR SEGV_ACCERR |
cbdee279 UD |
122 | }; |
123 | ||
124 | /* `si_code' values for SIGBUS signal. */ | |
125 | enum | |
126 | { | |
127 | BUS_ADRALN = 1, /* Invalid address alignment. */ | |
bd355af0 | 128 | # define BUS_ADRALN BUS_ADRALN |
cbdee279 | 129 | BUS_ADRERR, /* Non-existant physical address. */ |
bd355af0 | 130 | # define BUS_ADRERR BUS_ADRERR |
cbdee279 | 131 | BUS_OBJERR /* Object specific hardware error. */ |
bd355af0 | 132 | # define BUS_OBJERR BUS_OBJERR |
cbdee279 UD |
133 | }; |
134 | ||
135 | /* `si_code' values for SIGTRAP signal. */ | |
136 | enum | |
137 | { | |
138 | TRAP_BRKPT = 1, /* Process breakpoint. */ | |
bd355af0 | 139 | # define TRAP_BRKPT TRAP_BRKPT |
cbdee279 | 140 | TRAP_TRACE /* Process trace trap. */ |
bd355af0 | 141 | # define TRAP_TRACE TRAP_TRACE |
cbdee279 UD |
142 | }; |
143 | ||
144 | /* `si_code' values for SIGCHLD signal. */ | |
145 | enum | |
146 | { | |
147 | CLD_EXITED = 1, /* Child has exited. */ | |
bd355af0 | 148 | # define CLD_EXITED CLD_EXITED |
cbdee279 | 149 | CLD_KILLED, /* Child was killed. */ |
bd355af0 | 150 | # define CLD_KILLED CLD_KILLED |
cbdee279 | 151 | CLD_DUMPED, /* Child terminated abnormally. */ |
bd355af0 | 152 | # define CLD_DUMPED CLD_DUMPED |
cbdee279 | 153 | CLD_TRAPPED, /* Traced child has trapped. */ |
bd355af0 | 154 | # define CLD_TRAPPED CLD_TRAPPED |
cbdee279 | 155 | CLD_STOPPED, /* Child has stopped. */ |
bd355af0 | 156 | # define CLD_STOPPED CLD_STOPPED |
cbdee279 | 157 | CLD_CONTINUED /* Stopped child has continued. */ |
bd355af0 | 158 | # define CLD_CONTINUED CLD_CONTINUED |
cbdee279 UD |
159 | }; |
160 | ||
161 | /* `si_code' values for SIGPOLL signal. */ | |
162 | enum | |
163 | { | |
164 | POLL_IN = 1, /* Data input available. */ | |
bd355af0 | 165 | # define POLL_IN POLL_IN |
cbdee279 | 166 | POLL_OUT, /* Output buffers available. */ |
bd355af0 | 167 | # define POLL_OUT POLL_OUT |
cbdee279 | 168 | POLL_MSG, /* Input message available. */ |
bd355af0 | 169 | # define POLL_MSG POLL_MSG |
cbdee279 | 170 | POLL_ERR, /* I/O error. */ |
bd355af0 | 171 | # define POLL_ERR POLL_ERR |
cbdee279 | 172 | POLL_PRI, /* High priority input available. */ |
bd355af0 | 173 | # define POLL_PRI POLL_PRI |
cbdee279 | 174 | POLL_HUP /* Device disconnected. */ |
bd355af0 | 175 | # define POLL_HUP POLL_HUP |
cbdee279 UD |
176 | }; |
177 | ||
bd355af0 UD |
178 | # undef __need_siginfo_t |
179 | #endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ | |
180 | ||
181 | ||
2ace5721 UD |
182 | #if (defined _SIGNAL_H || defined __need_sigevent_t) \ |
183 | && !defined __have_sigevent_t | |
bd355af0 | 184 | # define __have_sigevent_t 1 |
cbdee279 UD |
185 | |
186 | /* Structure to transport application-defined values with signals. */ | |
bd355af0 UD |
187 | # define SIGEV_MAX_SIZE 64 |
188 | # define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE / sizeof (int)) - 3) | |
cbdee279 UD |
189 | |
190 | typedef struct sigevent | |
191 | { | |
192 | sigval_t sigev_value; | |
193 | int sigev_signo; | |
194 | int sigev_notify; | |
bcaad6ee | 195 | void (*sigev_notify_function) (sigval_t); /* Function to start. */ |
cbdee279 UD |
196 | void *sigev_notify_attributes; /* Really pthread_attr_t.*/ |
197 | } sigevent_t; | |
198 | ||
199 | /* `sigev_notify' values. */ | |
200 | enum | |
201 | { | |
202 | SIGEV_SIGNAL = 0, /* Notify via signal. */ | |
bd355af0 | 203 | # define SIGEV_SIGNAL SIGEV_SIGNAL |
cbdee279 | 204 | SIGEV_NONE, /* Other notification: meaningless. */ |
bd355af0 | 205 | # define SIGEV_NONE SIGEV_NONE |
cbdee279 | 206 | SIGEV_THREAD /* Deliver via thread creation. */ |
bd355af0 | 207 | # define SIGEV_THREAD SIGEV_THREAD |
cbdee279 | 208 | }; |
bd355af0 UD |
209 | |
210 | #endif /* have _SIGNAL_H. */ |