Question: 1 . 1 . Write a program which displays the parent's process Id and its process Id . Source code ( 2 Marks ) Output

1.1. Write a program which displays the parent's process Id and its process Id.
Source code (2 Marks)
Output screenshot
1.2. Create a child process by using fork() system call in which the parent displays a message that it has created a child process and also displays its childs process id.
Source code (2 Marks)
Output screenshot
1.3. Child should display a message that I will execute cat command after 4 seconds and go to sleep() for 4sec, Next it should display message that I am executing cat command
Source code (2 Marks)
Output screenshot
1.4. Use execl() system call to execute cat commands.
Source code
Output screenshot
1.5. Finally, control should return to parent and Parent should display My Child is dead
Source code (2 Marks)
Output screenshot

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!