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)
81 #define BUS_MCEERR_AR 4
82 #define BUS_MCEERR_AO 5
89 #define CLD_CONTINUED 6
97 #ifdef __SI_SWAP_ERRNO_CODE
98 int si_signo
, si_code
, si_errno
;
100 int si_signo
, si_errno
, si_code
;
103 char __pad
[128 - 2*sizeof(int) - sizeof(long)];
116 union sigval si_value
;
119 clock_t si_utime
, si_stime
;
142 #define si_pid __si_fields.__si_common.__first.__piduid.si_pid
143 #define si_uid __si_fields.__si_common.__first.__piduid.si_uid
144 #define si_status __si_fields.__si_common.__second.__sigchld.si_status
145 #define si_utime __si_fields.__si_common.__second.__sigchld.si_utime
146 #define si_stime __si_fields.__si_common.__second.__sigchld.si_stime
147 #define si_value __si_fields.__si_common.__second.si_value
148 #define si_addr __si_fields.__sigfault.si_addr
149 #define si_addr_lsb __si_fields.__sigfault.si_addr_lsb
150 #define si_lower __si_fields.__sigfault.__addr_bnd.si_lower
151 #define si_upper __si_fields.__sigfault.__addr_bnd.si_upper
152 #define si_band __si_fields.__sigpoll.si_band
153 #define si_fd __si_fields.__sigpoll.si_fd
154 #define si_timerid __si_fields.__si_common.__first.__timer.si_timerid
155 #define si_overrun __si_fields.__si_common.__first.__timer.si_overrun
156 #define si_ptr si_value.sival_ptr
157 #define si_int si_value.sival_int
158 #define si_call_addr __si_fields.__sigsys.si_call_addr
159 #define si_syscall __si_fields.__sigsys.si_syscall
160 #define si_arch __si_fields.__sigsys.si_arch
164 void (*sa_handler
)(int);
165 void (*sa_sigaction
)(int, siginfo_t
*, void *);
169 void (*sa_restorer
)(void);
171 #define sa_handler __sa_handler.sa_handler
172 #define sa_sigaction __sa_handler.sa_sigaction
175 union sigval sigev_value
;
178 void (*sigev_notify_function
)(union sigval
);
179 pthread_attr_t
*sigev_notify_attributes
;
180 char __pad
[56-3*sizeof(long)];
183 #define SIGEV_SIGNAL 0
185 #define SIGEV_THREAD 2
187 int __libc_current_sigrtmin(void);
188 int __libc_current_sigrtmax(void);
190 #define SIGRTMIN (__libc_current_sigrtmin())
191 #define SIGRTMAX (__libc_current_sigrtmax())
193 int kill(pid_t
, int);
195 int sigemptyset(sigset_t
*);
196 int sigfillset(sigset_t
*);
197 int sigaddset(sigset_t
*, int);
198 int sigdelset(sigset_t
*, int);
199 int sigismember(const sigset_t
*, int);
201 int sigprocmask(int, const sigset_t
*__restrict
, sigset_t
*__restrict
);
202 int sigsuspend(const sigset_t
*);
203 int sigaction(int, const struct sigaction
*__restrict
, struct sigaction
*__restrict
);
204 int sigpending(sigset_t
*);
205 int sigwait(const sigset_t
*__restrict
, int *__restrict
);
206 int sigwaitinfo(const sigset_t
*__restrict
, siginfo_t
*__restrict
);
207 int sigtimedwait(const sigset_t
*__restrict
, siginfo_t
*__restrict
, const struct timespec
*__restrict
);
208 int sigqueue(pid_t
, int, const union sigval
);
210 int pthread_sigmask(int, const sigset_t
*__restrict
, sigset_t
*__restrict
);
211 int pthread_kill(pthread_t
, int);
213 void psiginfo(const siginfo_t
*, const char *);
214 void psignal(int, const char *);
218 #if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
219 int killpg(pid_t
, int);
220 int sigaltstack(const stack_t
*__restrict
, stack_t
*__restrict
);
223 int siginterrupt(int, int);
226 void (*sigset(int, void (*)(int)))(int);
239 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
241 typedef void (*sig_t
)(int);
245 typedef void (*sighandler_t
)(int);
246 void (*bsd_signal(int, void (*)(int)))(int);
247 int sigisemptyset(const sigset_t
*);
248 int sigorset (sigset_t
*, const sigset_t
*, const sigset_t
*);
249 int sigandset(sigset_t
*, const sigset_t
*, const sigset_t
*);
251 #define SA_NOMASK SA_NODEFER
252 #define SA_ONESHOT SA_RESETHAND
255 #define SIG_ERR ((void (*)(int))-1)
256 #define SIG_DFL ((void (*)(int)) 0)
257 #define SIG_IGN ((void (*)(int)) 1)
259 typedef int sig_atomic_t;
261 void (*signal(int, void (*)(int)))(int);