2 * sigact.h - sigaction et al
8 * This header is the interface to a fake sigaction(2)
9 * implementation. It provides a POSIX compliant interface
10 * to whatever signal handling mechanisms are available.
11 * It also provides a Signal() function that is implemented
12 * in terms of sigaction().
13 * If not using signal(2) as part of the underlying
14 * implementation (USE_SIGNAL or USE_SIGMASK), and
15 * NO_SIGNAL is not defined, it also provides a signal()
16 * function that calls Signal().
23 * $Id: sigact.h,v 1.4 2021/10/14 19:39:17 sjg Exp $
28 #include <sys/cdefs.h>
31 * most modern systems use void for signal handlers but
35 # define SIG_HDLR void
39 * if you want to install this header as signal.h,
40 * modify this to pick up the original signal.h
46 # include <sys/signal.h>
50 # define SIG_ERR (SIG_HDLR (*)())-1
53 # define BADSIG SIG_ERR
57 /* we assume we need the fake sigaction */
59 #define SA_NOCLDSTOP 1 /* don't send SIGCHLD on child stop */
60 #define SA_RESTART 2 /* re-start I/O */
62 /* sigprocmask flags */
68 * this is a bit untidy
71 typedef _SIGSET_T_ sigset_t;
75 * POSIX sa_handler should return void, but since we are
76 * implementing in terms of something else, it may
77 * be appropriate to use the normal SIG_HDLR return type
81 SIG_HDLR (*sa_handler)();
87 int sigaction ( int /*sig*/, const struct sigaction */*act*/, struct sigaction */*oact*/ );
88 int sigaddset ( sigset_t */*mask*/, int /*sig*/ );
89 int sigdelset ( sigset_t */*mask*/, int /*sig*/ );
90 int sigemptyset ( sigset_t */*mask*/ );
91 int sigfillset ( sigset_t */*mask*/ );
92 int sigismember ( const sigset_t */*mask*/, int /*sig*/ );
93 int sigpending ( sigset_t */*set*/ );
94 int sigprocmask ( int how, const sigset_t */*set*/, sigset_t */*oset*/ );
95 int sigsuspend ( sigset_t */*mask*/ );
98 # define sigmask(s) (1<<((s)-1) & (32 - 1)) /* convert SIGnum to mask */
100 #if !defined(NSIG) && defined(_NSIG)
103 #endif /* ! SA_NOCLDSTOP */
104 #endif /* _SIGACT_H */