31 int save_errno =
errno;
56 #define SIGIO_MASK (1 << SIGIO_BIT)
58 #define SIGVTALRM_BIT 1
59 #define SIGVTALRM_MASK (1 << SIGVTALRM_BIT)
61 static int signals_enabled;
62 static unsigned int signals_pending;
68 enabled = signals_enabled;
69 if (!enabled && (sig ==
SIGIO)) {
76 sig_handler_common(sig, si, mc);
96 enabled = signals_enabled;
97 if (!signals_enabled) {
104 real_alarm_handler(mc);
116 .ss_sp = (__ptr_t) sig_stack,
117 .ss_size = size -
sizeof(
void *) });
120 panic(
"enabling signal stack failed, errno = %d\n",
errno);
136 static void hard_handler(
int sig,
siginfo_t *si,
void *
p)
140 unsigned long pending = 1
UL <<
sig;
159 nested = pending & 1;
162 while ((sig =
ffs(pending)) != 0){
164 pending &= ~(1 <<
sig);
165 (*handlers[
sig])(sig, si, mc);
185 action.sa_sigaction = hard_handler;
202 panic(
"sigaction failed - errno = %d\n",
errno);
204 sigemptyset(&sig_mask);
205 sigaddset(&sig_mask, sig);
207 panic(
"sigprocmask failed - errno = %d\n",
errno);
214 sigemptyset(&sigset);
215 sigaddset(&sigset, signal);
238 if (signals_enabled == 1)
259 save_pending = signals_pending;
260 if (save_pending == 0)
285 real_alarm_handler(
NULL);
291 return signals_enabled;
297 if (signals_enabled == enable)
300 ret = signals_enabled;