blob: 540236a5b2970863f326be3a255e7121b4d54d75 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#ifndef _SIGNAL_H
2#define _SIGNAL_H
3
4#ifdef __cplusplus
5extern "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
20typedef int sig_atomic_t;
21
22struct 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
35typedef struct
36{
37 void *ss_sp;
38 int ss_flags;
39 size_t ss_size;
40} stack_t;
41
42union sigval
43{
44 int sival_int;
45 void *sival_ptr;
46};
47
48#include <bits/signal.h>
49
50int __libc_current_sigrtmin(void);
51int __libc_current_sigrtmax(void);
52
53#define SIGRTMIN (__libc_current_sigrtmin())
54#define SIGRTMAX (__libc_current_sigrtmax())
55
56void (*signal(int, void (*)(int)))(int);
57void (*bsd_signal(int, void (*)(int)))(int);
58int kill(pid_t, int);
59int killpg(pid_t, int);
60int raise(int);
61int sigpause(int);
62
63int sigemptyset(sigset_t *);
64int sigfillset(sigset_t *);
65int sigaddset(sigset_t *, int);
66int sigdelset(sigset_t *, int);
67int sigismember(const sigset_t *, int);
68
69int sigprocmask(int, const sigset_t *, sigset_t *);
70int sigsuspend(const sigset_t *);
71int sigaction(int, const struct sigaction *, struct sigaction *);
72int sigpending(sigset_t *);
73int sigwait(const sigset_t *, int *);
74int sigwaitinfo(const sigset_t *, siginfo_t *);
75int sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *);
76int sigqueue(pid_t, int, const union sigval);
77
78int siginterrupt(int, int);
79
80int sigaltstack(const stack_t *, stack_t *);
81
82int sighold(int);
83int sigrelse(int);
84int sigignore(int);
85void (*sigset(int, void (*)(int)))(int);
86
87int pthread_sigmask(int, const sigset_t *, sigset_t *);
88int pthread_kill(pthread_t, int);
89
90#ifdef _GNU_SOURCE
91typedef int (*sighandler_t)(int);
92#endif
93
94#ifdef __cplusplus
95}
96#endif
97
98#endif