Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame^] | 1 | #ifndef _SIGNAL_H |
| 2 | #define _SIGNAL_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | #define __NEED_size_t |
| 9 | #define __NEED_pid_t |
| 10 | #define __NEED_uid_t |
| 11 | #define __NEED_struct_timespec |
| 12 | #define __NEED_pthread_t |
| 13 | #define __NEED_time_t |
| 14 | #define __NEED_clock_t |
| 15 | #define __NEED_sigset_t |
| 16 | #define __NEED_siginfo_t |
| 17 | |
| 18 | #include <bits/alltypes.h> |
| 19 | |
| 20 | typedef int sig_atomic_t; |
| 21 | |
| 22 | struct sigaction |
| 23 | { |
| 24 | union { |
| 25 | void (*sa_handler)(int); |
| 26 | void (*sa_sigaction)(int, siginfo_t *, void *); |
| 27 | } __sa_handler; |
| 28 | sigset_t sa_mask; |
| 29 | int sa_flags; |
| 30 | void (*__sa_restorer)(void); |
| 31 | }; |
| 32 | #define sa_handler __sa_handler.sa_handler |
| 33 | #define sa_sigaction __sa_handler.sa_sigaction |
| 34 | |
| 35 | typedef struct |
| 36 | { |
| 37 | void *ss_sp; |
| 38 | int ss_flags; |
| 39 | size_t ss_size; |
| 40 | } stack_t; |
| 41 | |
| 42 | union sigval |
| 43 | { |
| 44 | int sival_int; |
| 45 | void *sival_ptr; |
| 46 | }; |
| 47 | |
| 48 | #include <bits/signal.h> |
| 49 | |
| 50 | int __libc_current_sigrtmin(void); |
| 51 | int __libc_current_sigrtmax(void); |
| 52 | |
| 53 | #define SIGRTMIN (__libc_current_sigrtmin()) |
| 54 | #define SIGRTMAX (__libc_current_sigrtmax()) |
| 55 | |
| 56 | void (*signal(int, void (*)(int)))(int); |
| 57 | void (*bsd_signal(int, void (*)(int)))(int); |
| 58 | int kill(pid_t, int); |
| 59 | int killpg(pid_t, int); |
| 60 | int raise(int); |
| 61 | int sigpause(int); |
| 62 | |
| 63 | int sigemptyset(sigset_t *); |
| 64 | int sigfillset(sigset_t *); |
| 65 | int sigaddset(sigset_t *, int); |
| 66 | int sigdelset(sigset_t *, int); |
| 67 | int sigismember(const sigset_t *, int); |
| 68 | |
| 69 | int sigprocmask(int, const sigset_t *, sigset_t *); |
| 70 | int sigsuspend(const sigset_t *); |
| 71 | int sigaction(int, const struct sigaction *, struct sigaction *); |
| 72 | int sigpending(sigset_t *); |
| 73 | int sigwait(const sigset_t *, int *); |
| 74 | int sigwaitinfo(const sigset_t *, siginfo_t *); |
| 75 | int sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *); |
| 76 | int sigqueue(pid_t, int, const union sigval); |
| 77 | |
| 78 | int siginterrupt(int, int); |
| 79 | |
| 80 | int sigaltstack(const stack_t *, stack_t *); |
| 81 | |
| 82 | int sighold(int); |
| 83 | int sigrelse(int); |
| 84 | int sigignore(int); |
| 85 | void (*sigset(int, void (*)(int)))(int); |
| 86 | |
| 87 | int pthread_sigmask(int, const sigset_t *, sigset_t *); |
| 88 | int pthread_kill(pthread_t, int); |
| 89 | |
| 90 | #ifdef _GNU_SOURCE |
| 91 | typedef int (*sighandler_t)(int); |
| 92 | #endif |
| 93 | |
| 94 | #ifdef __cplusplus |
| 95 | } |
| 96 | #endif |
| 97 | |
| 98 | #endif |