TP-systeme-exploitation-cen.../TP1/fournitures/forktest.c

12 lines
409 B
C
Raw Normal View History

2023-06-20 18:57:09 +00:00
#include <stdio.h> /* printf */
#include <unistd.h> /* fork */
#include <stdlib.h> /* EXIT_SUCCESS */
int main() {
fork(); printf("fork 1 : processus %d, de père %d\n", getpid(), getppid());
fork(); printf("fork 2 : processus %d, de père %d\n", getpid(), getppid());
fork(); printf("fork 3 : processus %d, de père %d\n", getpid(), getppid());
//sleep(180);
return EXIT_SUCCESS;
}