2020-05-02 00:01:44 +02:00

14 lines
481 B
C
Executable File

/******************************************************/
/* demo_fork : Ce programme illustre le mecanisme de */
/* duplication d'images de LINUX. */
/******************************************************/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main()
{ int res;
res = fork();
if (res == -1) {perror ("demo_fork - fork"); exit (1);}
printf ("\nProcessus %d (pere : %d) - res ='%d'\n", getpid (), getppid (), res);
}