ajout fichiers
This commit is contained in:
15
TP2/Exercices/Ex4.c
Normal file
15
TP2/Exercices/Ex4.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
pid_t pid = fork();
|
||||
if (pid == 0) {
|
||||
printf("Mon père est %d\n", getppid());
|
||||
sleep(0.2);
|
||||
printf("Mon nouveau père est %d\n", getppid());
|
||||
}
|
||||
sleep(0.1);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user