#include "usg_common.h"
|
static void sig_quit1(int);
|
static void sig_quit2(int);
|
int
|
main(void)
|
{
|
sigset_t
|
newmask, oldmask, pendmask;
|
if (Signal(SIGQUIT, sig_quit1) == SIG_ERR)
|
err_exit(errno, "can’t catch SIGQUIT");
|
|
if (Signal(SIGQUIT, sig_quit2) == SIG_ERR)
|
err_exit(errno, "can’t catch SIGQUIT");
|
|
sleep(15);
|
exit(0);
|
/* SIGQUIT here will terminate with core file */
|
}
|
|
static void sig_quit1(int signo)
|
{
|
printf("caught SIGQUIT 1\n");
|
|
}
|
|
|
static void sig_quit2(int signo)
|
{
|
printf("caught SIGQUIT 2\n");
|
|
}
|