Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

These questions are Operating System in Linux Exercise 1: Fork and Process Tree Type the following program correctly in nano editor C GNU nano 5.8

"These questions are Operating System in Linux" 

image text in transcribed

Exercise 1: Fork and Process Tree Type the following program correctly in nano editor C GNU nano 5.8 fork3.C include include cunistd.lv int main() C int pidi, pidz, pid3; pidl = fork(): if (pidl - 0) printf(" I love "); else printf(" operating Systems "); pidz - fork(); if (pid == e) { printf(" difficult "); pid3 - forkt); printf("in but intersting! ) } else printf(" ctass. "); return 0; 2. Once you finished typing the above code, save the file using menu Writeout command os fork3.c. 4. Exit nano editor by pressing plus X keys as indicated at the bottom of nano interface 5. Compile the above program by typing "gec fork3.c" in the Terminal window. 6. Execute the generated binary file by typing./a.out in the Terminal window and observe the generated output 7. Take a screenshot for your Terminal window as you completed the above steps. 8. Draw a Process Tree to illustrate parent-child relationship for the above C code For each node on the tree, write the following information: The process identifier (assumed that the parent process identifier is assigned with an integer 21). The return value of each fork() statements ** For this step 8, draw your answer on paper and take a picture a 2. Upload the images for screenshot & captured picture for Step 7 & 8 below

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Get Funded The Startup Entrepreneurs Guide To Seriously Successful Fundraising

Authors: John Biggs, Eric Villines

1st Edition

1260459063, 978-1260459067

Students also viewed these Databases questions