X-Git-Url: https://git.piment-noir.org/?p=TD_SE.git;a=blobdiff_plain;f=TD3%2Fexo4%2Fexo4.c;h=717a9d7a29ae176fb045211b2e354ad0025d6ec0;hp=e835d0d44505cf72cfdb4acff9d5f8b13d379417;hb=84f86bf023000bab0245ad43204a409eab734b07;hpb=fa1b4804896b3db52c1e9b614cd00162fcfb8754 diff --git a/TD3/exo4/exo4.c b/TD3/exo4/exo4.c index e835d0d..717a9d7 100644 --- a/TD3/exo4/exo4.c +++ b/TD3/exo4/exo4.c @@ -6,14 +6,20 @@ void sigintP() { + printf("pid=%d\n", getpid()); + signal(SIGINT, sigintP); } void sigalrm() { + exit(1); } void sigintF() { + signal(SIGINT, SIG_IGN); + signal(SIGALRM, sigalrm); + alarm(5); } void sigchld()