45 #ifdef MISSING_SIGSET_T
47 int sigemptyset(sigset_t *m)
52 int sigaddset(sigset_t *set,
int signum)
54 *set |= sigmask(signum);
58 int sigprocmask(
int how, sigset_t *set, sigset_t *old)
63 previous = sigblock(*set);
64 else if (how == SIG_SETMASK)
65 previous = sigsetmask(*set);
66 else if (how == SIG_UNBLOCK) {
69 previous = sigsetmask(m & ~*set);
82 #ifdef MISSING_SIGACTION
84 static struct sigaction actions[NSIG] = {};
86 static int sighandle(
int signum)
88 if (signum == SIGCHLD) {
91 actions[signum].sa_handler(signum);
94 int sigaction(
int sig,
struct sigaction *act,
struct sigaction *oact)
96 static int initialized = 0;
101 for (i = 0; i < NSIG; i++)
102 actions[i].sa_handler = SIG_DFL;
105 if (sig <= 0 || sig >= NSIG) {
110 *oact = actions[sig];
113 struct sigvec mine = {
114 sighandle, act->sa_mask,
115 act->sa_flags & SA_RESTART ? SV_INTERRUPT : 0
118 if (sigvec(sig, &mine, NULL))