ASR3.1/Controle/Exercice 1/A.c

17 lines
280 B
C
Raw Permalink Normal View History

2021-10-08 15:33:49 +02:00
#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;
}