ASR3/ASR3.1/TP03 Processus/exercie4.c

43 lines
405 B
C
Raw Normal View History

2021-10-11 17:45:26 +02:00
#include<stdio.h>
#include<stdlib.h>
#include <unistd.h>
#include<assert.h>
#include<sys/wait.h>
int main(int argc, char * argv[]){
int status;
pid_t p;
p = fork();
//Gestion des erreurs
if (p == -1) {
perror("ERREUR\n");
return EXIT_FAILURE;
}
//Père
if (p>0) {
printf ("Le pid %d\n", getpid());
}
//Fils
if (p==0) {
}
wait (&status);
return EXIT_SUCCESS;
}