"debut TD0"
This commit is contained in:
19
2019-2020/S3T_TP_05_PROCESSUS-4-SIGNAUX/Demonstrations/demo_kill.c
Executable file
19
2019-2020/S3T_TP_05_PROCESSUS-4-SIGNAUX/Demonstrations/demo_kill.c
Executable file
@@ -0,0 +1,19 @@
|
||||
/************************************************/
|
||||
/* */
|
||||
/* demo_kill.c : Utilisation de la routine kill */
|
||||
/* */
|
||||
/************************************************/
|
||||
# include <stdio.h>
|
||||
# include <signal.h>
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
printf ("\nJe commence et j'attends 3 secondes...\n");
|
||||
sleep (3);
|
||||
printf ("\n... puis je me suicide par kill - %d - \n", getpid());
|
||||
kill (getpid(), SIGKILL);
|
||||
printf ("\n... je suis mort\n");
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user