Question: c language . Write a program that creates a child process. The child and parent processes have the following roles: The child process reads an

c language c language . Write a program that creates a child process. The

. Write a program that creates a child process. The child and parent processes have the following roles: The child process reads an integer value from the keyboard, and returns it as the exit status of the program, either with a return statement in the main function, or with an invocation to function exit. The parent process waits for the child process to finish, and prints the child's exit status on the screen, which should be equal to the value read from the keyboard. Read the man pages for function wait to see the details on how to capture the child's exit status, This is an example of the program output: s /93 Enter a number: 34 child exited with status 34 printed by child printed by parent

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!