+#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
+
struct __siginfo
{
int si_signo;
#define SIG_UNBLOCK 1
#define SIG_SETMASK 2
-#define SIG_ERR ((void (*)(int))-1)
-#define SIG_DFL ((void (*)(int)) 0)
-#define SIG_IGN ((void (*)(int)) 1)
#define SIG_HOLD ((void (*)(int)) 2)
+#endif
+
+#ifdef _GNU_SOURCE
#define NSIG 64
+#endif
+
+#define SIG_ERR ((void (*)(int))-1)
+#define SIG_DFL ((void (*)(int)) 0)
+#define SIG_IGN ((void (*)(int)) 1)
#define SIGHUP 1
#define SIGINT 2
extern "C" {
#endif
+#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
+
#define __NEED_size_t
#define __NEED_pid_t
#define __NEED_uid_t
#include <bits/alltypes.h>
-typedef int sig_atomic_t;
-
struct sigaction
{
union {
#define SIGRTMIN (__libc_current_sigrtmin())
#define SIGRTMAX (__libc_current_sigrtmax())
-void (*signal(int, void (*)(int)))(int);
-void (*bsd_signal(int, void (*)(int)))(int);
int kill(pid_t, int);
-int killpg(pid_t, int);
-int raise(int);
-int sigpause(int);
int sigemptyset(sigset_t *);
int sigfillset(sigset_t *);
int sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *);
int sigqueue(pid_t, int, const union sigval);
-int siginterrupt(int, int);
+int pthread_sigmask(int, const sigset_t *, sigset_t *);
+int pthread_kill(pthread_t, int);
-int sigaltstack(const stack_t *, stack_t *);
+#endif
+#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
+int killpg(pid_t, int);
+int sigaltstack(const stack_t *, stack_t *);
int sighold(int);
-int sigrelse(int);
int sigignore(int);
+int siginterrupt(int, int);
+int sigpause(int);
+int sigrelse(int);
void (*sigset(int, void (*)(int)))(int);
-
-int pthread_sigmask(int, const sigset_t *, sigset_t *);
-int pthread_kill(pthread_t, int);
+#endif
#ifdef _GNU_SOURCE
typedef int (*sighandler_t)(int);
+void (*bsd_signal(int, void (*)(int)))(int);
#endif
+typedef int sig_atomic_t;
+
+void (*signal(int, void (*)(int)))(int);
+int raise(int);
+
#ifdef __cplusplus
}
#endif