This commit is contained in:
2025-09-30 13:22:20 +02:00
parent 87565cf26c
commit 2513e0256c
6 changed files with 59 additions and 0 deletions

20
SCR3.1/TP4/Exo2/parexec.c Normal file
View File

@@ -0,0 +1,20 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <string.h>
int main(int argc, char *argv[]) {
int n = argc - 2;
pid_t pids[n];
for (int i = 0; i < n; i++)
{
pids[i] = fork();
}
for (int i = 0; i < n; i++)
{
waitpid(pids[i], NULL, 0);
}
return 0;
}