Old stuff/ecole_etude_fac_de_pau/licence_3/systeme-d-exploitation/tp2/3.c~
(Deskargatu)#include <stdlio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
int main()
{
pid_t pid;
pid = fork();
if (pid == -1 ) { perror("error fork"); exit(-1); }
if (pid == 0)
{
printf("Le fils a pour pid : %d\n",getpid());
}
else{
wait(pid);
printf("le pere a pour pid: %d\n",getpid());
}
}