我注意到它sigaction
被定义为一个结构和一个函数(http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html):
int sigaction(int, const struct sigaction *restrict,
struct sigaction *restrict);
使用它的一个例子是:
struct sigaction sa;
/* Set up handler */
sa.sa_flags = SA_SIGINFO|SA_RESTART;
sa.sa_sigaction = timer_expiry;
/* Setup signal watchdog */
if (sigaction(SIG_WDOG, &sa, NULL) == -1) {
printf("ERROR: Failed to set wdog signal with %s",
strerror(errno));
}