/**********************************************************/ /* DUT INFORMATIQUE - M311 - R. CHIGNOLI */ /* demo_alarm.c : Utilisation du signal SIGALRM par alarm */ /**********************************************************/ #include #include #include #include #include void rep_SIGALRM () { printf ("\n*** Processus %d : Signal SIGALRM recu\n\n", getpid()); exit(0); } int main (int argc, char* argv[]) { int res; assert (argc == 2); signal (SIGALRM, rep_SIGALRM); printf ("\n*** Processus %d : Je m' endors ......\n", getpid()); res = alarm (atoi(argv[1])); for (;;); }