cours_progra/bac2/os/chap3/ex1.c

18 lines
253 B
C
Raw Normal View History

2023-10-24 15:48:13 +02:00
#include <unistd.h>
#include <stdio.h>
#define printv(x) printf("%s = %d\n", (#x), (x))
int main(void)
{
int f1, f2, f3;
f1 = fork();
printv(f1);
f2 = fork();
printv(f2);
f3 = fork();
printv(f3);
printf(" all => %d, %d, %d\n", f1, f2, f3);
}