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>
30 #define SIG_HOLD ((void (*)(int)) 2)
36 #define SI_ASYNCNL (-60)
39 #define SI_ASYNCIO (-4)
71 #define BUS_MCEERR_AR 4
72 #define BUS_MCEERR_AO 5
79 #define CLD_CONTINUED 6
81 typedef struct sigaltstack stack_t
;
89 int si_signo
, si_errno
, si_code
;
91 char __pad
[128 - 2*sizeof(int) - sizeof(long)];
104 union sigval si_value
;
107 clock_t si_utime
, si_stime
;
130 #define si_pid __si_fields.__si_common.__first.__piduid.si_pid
131 #define si_uid __si_fields.__si_common.__first.__piduid.si_uid
132 #define si_status __si_fields.__si_common.__second.__sigchld.si_status
133 #define si_utime __si_fields.__si_common.__second.__sigchld.si_utime
134 #define si_stime __si_fields.__si_common.__second.__sigchld.si_stime
135 #define si_value __si_fields.__si_common.__second.si_value
136 #define si_addr __si_fields.__sigfault.si_addr
137 #define si_addr_lsb __si_fields.__sigfault.si_addr_lsb
138 #define si_lower __si_fields.__sigfault.__addr_bnd.si_lower
139 #define si_upper __si_fields.__sigfault.__addr_bnd.si_upper
140 #define si_band __si_fields.__sigpoll.si_band
141 #define si_fd __si_fields.__sigpoll.si_fd
142 #define si_timerid __si_fields.__si_common.__first.__timer.si_timerid
143 #define si_overrun __si_fields.__si_common.__first.__timer.si_overrun
144 #define si_ptr si_value.sival_ptr
145 #define si_int si_value.sival_int
146 #define si_call_addr __si_fields.__sigsys.si_call_addr
147 #define si_syscall __si_fields.__sigsys.si_syscall
148 #define si_arch __si_fields.__sigsys.si_arch
152 void (*sa_handler
)(int);
153 void (*sa_sigaction
)(int, siginfo_t
*, void *);
157 void (*sa_restorer
)(void);
159 #define sa_handler __sa_handler.sa_handler
160 #define sa_sigaction __sa_handler.sa_sigaction
163 union sigval sigev_value
;
166 void (*sigev_notify_function
)(union sigval
);
167 pthread_attr_t
*sigev_notify_attributes
;
168 char __pad
[56-3*sizeof(long)];
171 #define SIGEV_SIGNAL 0
173 #define SIGEV_THREAD 2
175 int __libc_current_sigrtmin(void);
176 int __libc_current_sigrtmax(void);
178 #define SIGRTMIN (__libc_current_sigrtmin())
179 #define SIGRTMAX (__libc_current_sigrtmax())
181 int kill(pid_t
, int);
183 int sigemptyset(sigset_t
*);
184 int sigfillset(sigset_t
*);
185 int sigaddset(sigset_t
*, int);
186 int sigdelset(sigset_t
*, int);
187 int sigismember(const sigset_t
*, int);
189 int sigprocmask(int, const sigset_t
*__restrict
, sigset_t
*__restrict
);
190 int sigsuspend(const sigset_t
*);
191 int sigaction(int, const struct sigaction
*__restrict
, struct sigaction
*__restrict
);
192 int sigpending(sigset_t
*);
193 int sigwait(const sigset_t
*__restrict
, int *__restrict
);
194 int sigwaitinfo(const sigset_t
*__restrict
, siginfo_t
*__restrict
);
195 int sigtimedwait(const sigset_t
*__restrict
, siginfo_t
*__restrict
, const struct timespec
*__restrict
);
196 int sigqueue(pid_t
, int, const union sigval
);
198 int pthread_sigmask(int, const sigset_t
*__restrict
, sigset_t
*__restrict
);
199 int pthread_kill(pthread_t
, int);
201 void psiginfo(const siginfo_t
*, const char *);
202 void psignal(int, const char *);
206 #if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
207 int killpg(pid_t
, int);
208 int sigaltstack(const stack_t
*__restrict
, stack_t
*__restrict
);
211 int siginterrupt(int, int);
214 void (*sigset(int, void (*)(int)))(int);
227 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
229 typedef void (*sig_t
)(int);
233 typedef void (*sighandler_t
)(int);
234 void (*bsd_signal(int, void (*)(int)))(int);
235 int sigisemptyset(const sigset_t
*);
236 int sigorset (sigset_t
*, const sigset_t
*, const sigset_t
*);
237 int sigandset(sigset_t
*, const sigset_t
*, const sigset_t
*);
239 #define SA_NOMASK SA_NODEFER
240 #define SA_ONESHOT SA_RESETHAND
243 #include <bits/signal.h>
245 #define SIG_ERR ((void (*)(int))-1)
246 #define SIG_DFL ((void (*)(int)) 0)
247 #define SIG_IGN ((void (*)(int)) 1)
249 typedef int sig_atomic_t;
251 void (*signal(int, void (*)(int)))(int);