X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TD3%2Fexo2%2Fmonexec%2Fmonexec.c;fp=TD3%2Fexo2%2Fmonexec%2Fmonexec.c;h=e7b20dd0f0753ee5b34ef86e05539d69b2b0c595;hb=01d700ab53176f4c319136e4ab9023018ffd3721;hp=0000000000000000000000000000000000000000;hpb=4b027192151451c4218def347e9d56e95858bc08;p=TD_SE.git diff --git a/TD3/exo2/monexec/monexec.c b/TD3/exo2/monexec/monexec.c new file mode 100644 index 0000000..e7b20dd --- /dev/null +++ b/TD3/exo2/monexec/monexec.c @@ -0,0 +1,19 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + pid_t pid; + + if ((pid = fork()) == -1) { + perror("erreur"); + exit(EXIT_FAILURE); + } else if (pid == 0) { + execvp(argv[1], argv + 1); + perror("execvp"); + } + + exit(EXIT_SUCCESS); +}