2 /* System processes use simpler macros with no range error checking (defined in
3 * signal.h). The ANSI signal() implementation now also uses the macro
4 * versions, which makes hiding of the functions here a historical remains.
6 * _NSIG is supposed to be the highest signal number plus one.
8 #define sigaddset _sigaddset
9 #define sigdelset _sigdelset
10 #define sigemptyset _sigemptyset
11 #define sigfillset _sigfillset
12 #define sigismember _sigismember
15 /* Low bit of signal masks. */
16 #define SIGBIT_0 ((sigset_t) 1)
18 /* Mask of valid signals (0 - (_NSIG-1)). */
19 #define SIGMASK ((SIGBIT_0 << _NSIG) - 1)
21 #define sigisvalid(signo) ((unsigned) (signo) < _NSIG)
23 PUBLIC
int sigaddset(set
, signo
)
27 if (!sigisvalid(signo
)) {
31 *set
|= SIGBIT_0
<< signo
;
35 PUBLIC
int sigdelset(set
, signo
)
39 if (!sigisvalid(signo
)) {
43 *set
&= ~(SIGBIT_0
<< signo
);
47 PUBLIC
int sigemptyset(set
)
54 PUBLIC
int sigfillset(set
)
61 PUBLIC
int sigismember(set
, signo
)
65 if (!sigisvalid(signo
)) {
69 if (*set
& (SIGBIT_0
<< signo
))