8 void show_proc_pids() {
9 pid_t current_pid
= getpid();
10 pid_t parent_pid
= getppid();
12 printf("[%d] Mon PID: %d\n", current_pid
, current_pid
);
13 printf("[%d] PID du parent: %d\n", current_pid
, parent_pid
);
24 printf("Erreur de clonage\n");
26 } else if (cpid
== 0) {
33 pid_t wpid
= wait(&status
);
34 printf("Fin du PID: %d\n", wpid
);
36 if (WIFEXITED(status
)) {
37 printf("Fils termine, status=%d\n", WEXITSTATUS(status
));
38 } else if (WIFSIGNALED(status
)) {
39 printf("Fils tue par un signal %d\n", WTERMSIG(status
));
40 } else if (WIFSTOPPED(status
)) {
41 printf("Fils stoppe par un signal %d\n", WSTOPSIG(status
));
42 } else if (WIFCONTINUED(status
)) {
43 printf("Fils continue\n");