add TP03 SCR
This commit is contained in:
10
SCR/SCR3.1/TP03/Exercise1/answer.txt
Normal file
10
SCR/SCR3.1/TP03/Exercise1/answer.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
PID PPID COMMAND S
|
||||
4331 1423 bash S
|
||||
4732 4331 \_ a.out S
|
||||
4733 4732 \_ a.out S
|
||||
4736 4733 | \_ a.o S
|
||||
4737 4733 | \_ a.o S
|
||||
4734 4732 \_ a.out S
|
||||
4735 4732 \_ a.out S
|
||||
|
||||
-> Il y aura donc 6 appels à a.out.
|
16
SCR/SCR3.1/TP03/Exercise1/main.c
Normal file
16
SCR/SCR3.1/TP03/Exercise1/main.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
|
||||
int main() {
|
||||
fork();
|
||||
|
||||
if (fork()){
|
||||
fork();
|
||||
}
|
||||
|
||||
printf("A\n");
|
||||
|
||||
sleep(20);
|
||||
}
|
Reference in New Issue
Block a user