ASR3.1/Controle/Exercice 1/A.c
2021-10-08 15:33:49 +02:00

17 lines
280 B
C

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char const *argv[]) {
char* arg[3] = {"B1", "1", NULL};
if (!fork()) {
execvp("B1", arg);
} else {
if (!fork()) {
arg[1] = "2";
execvp("B1", arg);
}
}
sleep(5);
return EXIT_SUCCESS;
}