diff --git a/Exemples/04-Exec/exoDuCours.c b/Exemples/04-Exec/exoDuCours.c new file mode 100644 index 0000000..d66bcd8 --- /dev/null +++ b/Exemples/04-Exec/exoDuCours.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + pid_t pid; + + pid = fork(); + + if (pid == 0) { + if (execlp("ps", "ps", "-l", NULL) == -1) + { + perror("dans le exec"); + exit (0); + } + + } else { + wait(NULL); + } + return EXIT_SUCCESS; +} \ No newline at end of file