/* signal.c: a Hugh-approved signal handler. */
volatile SIG_ATOMIC_T slow
, interrupt_happened
;
void (*sighandlers
[NUMOFSIGNALS
])(int);
static volatile SIG_ATOMIC_T sigcount
, caught
[NUMOFSIGNALS
];
extern void catcher(int s
) {
exit(1); /* exit unconditionally on a signal in a child process */
interrupt_happened
= TRUE
;
return; /* ho hum; life as usual */
exit(1); /* exit unconditionally on a signal in a child process */
for (i
= 0, s
= -1; i
< NUMOFSIGNALS
; i
++)
panic("all-zero sig vector with nonzero sigcount");
if ((h
= sighandlers
[s
]) == SIG_DFL
)
panic("caught signal set to SIG_DFL");
panic("caught signal set to SIG_IGN");
extern void (*rc_signal(int s
, void (*h
)(int)))(int) {
if (h
== SIG_DFL
|| h
== SIG_IGN
) {
extern void initsignal() {
for (i
= 1; i
< NUMOFSIGNALS
; i
++) {
if ((h
= signal(i
, SIG_DFL
)) != SIG_DFL
)