Assignment 4449432
Assignment 4449432
Assignment 4
WAP to create 3 child process from
the same parent
• Pre- requisites:-
Knowledge about system calls
Knowledge about process
Working of fork & wait system calls
• Objective
To understand how to use fork system calls
Assignment 4
Requirements:-
1. Create 3 child process from the same parent.
Assignment 4
Requirements:-
1. Create 3 child process from the same parent.
Parent
Assignment 4
Requirements:-
1. Create 3 child process from the same parent.
Parent
Child1 Parent
Assignment 4
Requirements:-
1. Create 3 child process from the same parent.
Parent
Child1 Parent
Child2 Parent
Assignment 4
Requirements:-
1. Create 3 child process from the same parent.
Parent
Child1 Parent
Child2 Parent
Child3 Parent
Assignment 4
Requirements:-
2. Parent has to wait for all the three child process.
Explanation:- Which means parent should not die until
all the three child finishes the execution.
3. Print exit status of each child when they
terminates
Assignment 4
Sample output
Child1 with pid 2020 created
Child2 with pid 2021 created
Child3 with pid 2022 created
Child 2020 is terminated with code 0
Child 2021 is terminated with code 0
Child 2022 is terminated with code 0
Assignment 4
Sample Output:-
Child1 with
pid 2020 Child1 Parent
created
Assignment 4
Sample Output:-
Parent pid 2019
Parent
Child1 with
pid 2020 Child1 Parent
created
Child1 with
pid 2020 Child1 Parent
created
Child3 Parent
Child3 with pid 2022 created
Assignment 4
Sample output
Parent pid 2019
Parent
Child1 Parent
Child2 Parent
Child2 Parent
Child3 Parent
Assignment 4
Sample output
Parent pid 2019
Parent
Child 2020 is
terminated Child1 Parent
with code 0
Sample output: -
Child1 with pid 2020 created
Child2 with pid 2021 created
Child3 with pid 2022 created
Child 2020 is terminated with code 0
Child 2021 is terminated with code 0
Child 2022 is terminated with code 0