14 lines
481 B
C
14 lines
481 B
C
|
/******************************************************/
|
||
|
/* 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);
|
||
|
}
|