Implement question 6
[TD_IML.git] / TD1 / exo.c
diff --git a/TD1/exo.c b/TD1/exo.c
deleted file mode 100644 (file)
index 237c2d6..0000000
--- a/TD1/exo.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-void show_proc_pids() {
-    pid_t current_pid = getpid();
-    pid_t parent_pid = getppid();
-
-    printf("[%d] Mon PID: %d\n", current_pid, current_pid);
-    printf("[%d] PID du parent: %d\n", current_pid, parent_pid);
-}
-
-int main() {
-    int status = 0;
-    printf("Courant:\n");
-    show_proc_pids();
-
-    pid_t rtf = fork();
-
-    if (rtf == -1) {
-        printf("Erreur de clonage\n");
-        exit(EXIT_FAILURE);
-    } else if (rtf == 0) {
-        printf("Fils:\n");
-        show_proc_pids();
-        exit(EXIT_FAILURE);
-    } else {
-        printf("Parent:\n");
-        show_proc_pids();
-        pid_t rtw = wait(&status);
-        system("ps aux");
-    }
-    
-    return EXIT_SUCCESS;
-}