1 /* $NetBSD: sigact.h,v 1.2 1997/01/12 19:12:16 tls Exp $ */
4 * sigact.h - sigaction et al
10 * This header is the interface to a fake sigaction(2)
11 * implementation. It provides a POSIX compliant interface
12 * to whatever signal handling mechanisms are available.
13 * It also provides a Signal() function that is implemented
14 * in terms of sigaction().
15 * If not using signal(2) as part of the underlying
16 * implementation (USE_SIGNAL or USE_SIGMASK), and
17 * NO_SIGNAL is not defined, it also provides a signal()
18 * function that calls Signal().
25 * $NetBSD: sigact.h,v 1.2 1997/01/12 19:12:16 tls Exp $
27 /* Changes to sigact.h for pdksh, Michael Rendell <michael@cs.mun.ca>:
28 * - changed SIG_HDLR to RETSIGTYPE for use with GNU autoconf
30 * - ifdef'd out ARGS(), volatile and const initializations
31 * - ifdef'd out sigset_t definition - let autoconf handle it
32 * - ifdef out routines not used in ksh if IS_KSH is defined
39 * most modern systems use void for signal handlers but
43 # define RETSIGTYPE void
47 #if 0 /* ARGS(), volatile and const are already set up in config*.h -mhr */
53 handler_t Signal
ARGS((int sig
, handler_t disp
));
57 * if you want to install this header as signal.h,
58 * modify this to pick up the original signal.h
65 # define SIG_ERR ((handler_t) -1)
68 # define BADSIG SIG_ERR
72 /* we assume we need the fake sigaction */
74 #define SA_NOCLDSTOP 1 /* don't send SIGCHLD on child stop */
75 #define SA_RESTART 2 /* re-start I/O */
77 /* sigprocmask flags */
82 #if 0 /* autoconf will define sigset_t if it isn't available */
84 * this is a bit untidy
86 #if !defined(__sys_stdtypes_h)
87 typedef unsigned int sigset_t
;
92 * POSIX sa_handler should return void, but since we are
93 * implementing in terms of something else, it may
94 * be appropriate to use the normal RETSIGTYPE return type
104 int sigaction
ARGS(( int sig
, struct sigaction
*act
, struct sigaction
*oact
));
105 int sigaddset
ARGS(( sigset_t
*mask
, int sig
));
107 int sigdelset
ARGS(( sigset_t
*mask
, int sig
));
109 int sigemptyset
ARGS(( sigset_t
*mask
));
111 int sigfillset
ARGS(( sigset_t
*mask
));
112 int sigismember
ARGS(( sigset_t
*mask
, int sig
));
113 int sigpending
ARGS(( sigset_t
*set
));
115 int sigprocmask
ARGS(( int how
, sigset_t
*set
, sigset_t
*oset
));
116 int sigsuspend
ARGS(( sigset_t
*mask
));
119 # define sigmask(s) (1<<((s)-1)) /* convert SIGnum to mask */
121 #if !defined(NSIG) && defined(_NSIG)
124 #endif /* ! SA_NOCLDSTOP */
125 #endif /* _SIGACT_H */