Question: A: Write a C/C++ program that forks off (creates) a new child process that sends 3 messages to its parent via a pipe created by

A: Write a C/C++ program that forks off (creates) a new child process that sends 3 messages to its parent via a pipe created by the parent process (your main program). Use write and read functions as explained in the class examples. The 3 messages should be 3 lines with different pieces of information: Your full name Your Department And your email address Hints: You need to use the following system calls (see the slides posted on Piazza on the topic): pipe(), fork(), and wait()

B: Rewrite the program from A to be sending 3 messages from the parent to the child.

C: In this question do refactoring on program A so that write and read functions are not used. Tip/Hint: use dup/dup2, with other output and input statements (e.g., cout, cin)

D: (firs part of the shell): In this phase (part 1) you need to work on your terminal (shell simulator) and accomplish the points (1, 2, and 3) explained above.

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!