10 DEFUN(handler
, (sig
), int sig
)
12 printf("Received signal %d (%s).\n", sig
, strsignal(sig
));
19 if (signal(SIGTERM
, handler
) == SIG_ERR
)
21 perror("signal: SIGTERM");
27 printf("Sending myself signal %d.\n", SIGTERM
);
30 if (raise(SIGTERM
) < 0)
32 perror("raise: SIGTERM");
38 puts("Didn't get any signal. Test FAILED!");
42 puts("Got a signal. Test succeeded.");