10 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
11 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
12 || defined(_BSD_SOURCE)
15 #define __ucontext ucontext
21 #define __NEED_struct_timespec
22 #define __NEED_pthread_t
23 #define __NEED_pthread_attr_t
25 #define __NEED_clock_t
26 #define __NEED_sigset_t
28 #include <bits/alltypes.h>
34 #define SI_ASYNCNL (-60)
37 #define SI_ASYNCIO (-4)
44 typedef struct sigaltstack stack_t
;
48 #include <bits/signal.h>
50 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
51 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
52 || defined(_BSD_SOURCE)
54 #define SIG_HOLD ((void (*)(int)) 2)
82 #define BUS_MCEERR_AR 4
83 #define BUS_MCEERR_AO 5
90 #define CLD_CONTINUED 6
98 #ifdef __SI_SWAP_ERRNO_CODE
99 int si_signo
, si_code
, si_errno
;
101 int si_signo
, si_errno
, si_code
;
104 char __pad
[128 - 2*sizeof(int) - sizeof(long)];
117 union sigval si_value
;
120 clock_t si_utime
, si_stime
;
146 #define si_pid __si_fields.__si_common.__first.__piduid.si_pid
147 #define si_uid __si_fields.__si_common.__first.__piduid.si_uid
148 #define si_status __si_fields.__si_common.__second.__sigchld.si_status
149 #define si_utime __si_fields.__si_common.__second.__sigchld.si_utime
150 #define si_stime __si_fields.__si_common.__second.__sigchld.si_stime
151 #define si_value __si_fields.__si_common.__second.si_value
152 #define si_addr __si_fields.__sigfault.si_addr
153 #define si_addr_lsb __si_fields.__sigfault.si_addr_lsb
154 #define si_lower __si_fields.__sigfault.__first.__addr_bnd.si_lower
155 #define si_upper __si_fields.__sigfault.__first.__addr_bnd.si_upper
156 #define si_pkey __si_fields.__sigfault.__first.si_pkey
157 #define si_band __si_fields.__sigpoll.si_band
158 #define si_fd __si_fields.__sigpoll.si_fd
159 #define si_timerid __si_fields.__si_common.__first.__timer.si_timerid
160 #define si_overrun __si_fields.__si_common.__first.__timer.si_overrun
161 #define si_ptr si_value.sival_ptr
162 #define si_int si_value.sival_int
163 #define si_call_addr __si_fields.__sigsys.si_call_addr
164 #define si_syscall __si_fields.__sigsys.si_syscall
165 #define si_arch __si_fields.__sigsys.si_arch
169 void (*sa_handler
)(int);
170 void (*sa_sigaction
)(int, siginfo_t
*, void *);
174 void (*sa_restorer
)(void);
176 #define sa_handler __sa_handler.sa_handler
177 #define sa_sigaction __sa_handler.sa_sigaction
180 union sigval sigev_value
;
183 void (*sigev_notify_function
)(union sigval
);
184 pthread_attr_t
*sigev_notify_attributes
;
185 char __pad
[56-3*sizeof(long)];
188 #define SIGEV_SIGNAL 0
190 #define SIGEV_THREAD 2
192 int __libc_current_sigrtmin(void);
193 int __libc_current_sigrtmax(void);
195 #define SIGRTMIN (__libc_current_sigrtmin())
196 #define SIGRTMAX (__libc_current_sigrtmax())
198 int kill(pid_t
, int);
200 int sigemptyset(sigset_t
*);
201 int sigfillset(sigset_t
*);
202 int sigaddset(sigset_t
*, int);
203 int sigdelset(sigset_t
*, int);
204 int sigismember(const sigset_t
*, int);
206 int sigprocmask(int, const sigset_t
*__restrict
, sigset_t
*__restrict
);
207 int sigsuspend(const sigset_t
*);
208 int sigaction(int, const struct sigaction
*__restrict
, struct sigaction
*__restrict
);
209 int sigpending(sigset_t
*);
210 int sigwait(const sigset_t
*__restrict
, int *__restrict
);
211 int sigwaitinfo(const sigset_t
*__restrict
, siginfo_t
*__restrict
);
212 int sigtimedwait(const sigset_t
*__restrict
, siginfo_t
*__restrict
, const struct timespec
*__restrict
);
213 int sigqueue(pid_t
, int, union sigval
);
215 int pthread_sigmask(int, const sigset_t
*__restrict
, sigset_t
*__restrict
);
216 int pthread_kill(pthread_t
, int);
218 void psiginfo(const siginfo_t
*, const char *);
219 void psignal(int, const char *);
223 #if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
224 int killpg(pid_t
, int);
225 int sigaltstack(const stack_t
*__restrict
, stack_t
*__restrict
);
228 int siginterrupt(int, int);
231 void (*sigset(int, void (*)(int)))(int);
234 #define TRAP_BRANCH 3
235 #define TRAP_HWBKPT 4
244 #define SS_AUTODISARM (1U << 31)
245 #define SS_FLAG_BITS SS_AUTODISARM
248 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
250 typedef void (*sig_t
)(int);
254 typedef void (*sighandler_t
)(int);
255 void (*bsd_signal(int, void (*)(int)))(int);
256 int sigisemptyset(const sigset_t
*);
257 int sigorset (sigset_t
*, const sigset_t
*, const sigset_t
*);
258 int sigandset(sigset_t
*, const sigset_t
*, const sigset_t
*);
260 #define SA_NOMASK SA_NODEFER
261 #define SA_ONESHOT SA_RESETHAND
264 #define SIG_ERR ((void (*)(int))-1)
265 #define SIG_DFL ((void (*)(int)) 0)
266 #define SIG_IGN ((void (*)(int)) 1)
268 typedef int sig_atomic_t;
270 void (*signal(int, void (*)(int)))(int);