cours_progra/bac2/os/chap1/ex6.c

23 lines
273 B
C
Raw Normal View History

2023-10-18 20:27:40 +02:00
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
void handler(int sig){
printf("test");
exit(0);
}
int main(int argc, char *argv[])
{
signal(SIGALRM, handler);
alarm(5);
getchar();
printf("finished without a thing");
return 0;
}