StudyingUnixInterface/10/signal/pause.c

17 lines
221 B
C
Raw Normal View History

2021-01-11 10:00:36 +00:00
#include <signal.h>
#include <unistd.h>
#include <stdio.h>
static void sig_alarm(int signo) {
}
int main(void) {
if(signal(SIGALRM, sig_alarm) == SIG_ERR)
return -1;
alarm(3);
pause();
return alarm(0);
}