Coding styles fixes.
[TD_SE.git] / signal / signaux0.c
CommitLineData
c3a3595d
JB
1// signaux0.c
2
3#include <signal.h>
4#include <stdio.h>
5#include <stdlib.h>
6#include <unistd.h>
7
151a0f56 8static int count = 0;
c3a3595d
JB
9
10static void action(int sig)
11{
12 ++count;
13 write(1, "capture du signal SIGINT\n", 26);
14}
15
16int main()
17{
18 // Spécification de l'action du signal
19 signal(SIGINT, action);
20 printf("Debut:\n");
21 do {
22 sleep(1);
23 } while (count < 3);
24 return 0;
25}