Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Creating Processes Using fork0 Due: February 14,2019, 11 am Log onto your Linux system. Under sre directory write C program to carry out the following

image text in transcribed
Creating Processes Using fork0 Due: February 14,2019, 11 am Log onto your Linux system. Under sre directory write C program to carry out the following task Create two processes and print out their process id& make them work File name: sre/forkTest2.c 1) The parent process creates two children, named as Alice and Bob, respectively 2) The parent prints out the process ID of Alice and Bob when the parent creates them as follows: From Parent: Alice ID is xx llhere xxxx is a positive integer From Parent: Bob ID is yyyy There yyyy is a positive integer printf ("From Parent: Alice ID is %d ", Alice!D); 4) Child Alice calculates the average of number 1,2,, 10, and prints it out as: 3) The parent waits for the two children to finish their work before exiting. From Alice: the average of 1,2,.. 10 is the-average-she-calculated Then exits. 5) Child Bob prints out the following string, then exits From Bob: I am born to print this and then die. Please take a screen shot of displaying the result and save it as result.jpg. Compress two files, forkTest2.c and jpg file into CA2_yourfirstname.zip and upload it on Ecourses

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

More Books

Students also viewed these Databases questions