Commentato il codice del server echo basato sulla funzione poll.
[gapil.git] / listati / sig_alarm.c
1 sig_atomic_t flag;
2 int main()
3 {
4     flag = 0;
5     ...
6     if (flag) {         /* test if signal occurred */
7         flag = 0;       /* reset flag */ 
8         do_response();  /* do things */
9     } else {
10         do_other();     /* do other things */
11     }
12     ...
13 }
14 void alarm_hand(int sig) 
15 {
16     /* set the flag */
17     flag = 1;
18     return;
19 }