First commit
This commit is contained in:
commit
5c269302ed
59 changed files with 5613 additions and 0 deletions
21
content/progsys/TDM_4-les_signaux/src/q1.c
Normal file
21
content/progsys/TDM_4-les_signaux/src/q1.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int i;
|
||||
|
||||
void signal_sigint(){
|
||||
printf("value : %d\n",i);
|
||||
//exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int main () {
|
||||
if((signal(SIGINT,signal_sigint)) == SIG_ERR){
|
||||
perror("unable to catch signal");
|
||||
}
|
||||
for (i=0; i<1000000; i++) {
|
||||
sleep(0.01);
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue