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 (rtf
== 0) {
33 pid_t rtw
= wait(&status
);
35 if (WIFEXITED(status
)) {
36 printf("Fils termine, status=%d\n", WEXITSTATUS(status
));
37 } else if (WIFSIGNALED(status
)) {
38 printf("Fils tue par un signal %d\n", WTERMSIG(status
));
39 } else if (WIFSTOPPED(status
)) {
40 printf("Fils stoppe par un signal %d\n", WSTOPSIG(status
));
41 } else if (WIFCONTINUED(status
)) {
42 printf("Fils continue\n");