Question: This program should be coded in C using Linux System Calls. Please do question 1 and I'll post question 2 sperately. More on Pipes Objective
This program should be coded in C using Linux System Calls. Please do question 1 and I'll post question 2 sperately.



More on Pipes Objective - To better understand the use of pipes to communicate between processes Submission One compressed file that contains all C and pdf files Make sure to do the following - Check the success of every system call you use - When using pipes, make sure to close the pipe-side the process will not use Description In this lab, we'll write a program to illustrate the basics of process creation and IPC to facilitate communication between three processes using pipes Send messages to child processes Write a C program that creates 2 child processes (C1 and C2) and 2 pipes and support sending an unlimited number of messages between the parent and either of the 2 child processes as shown in Figure 1 below 1. Parent C2 C1 Figure 1: Communication between a parent and 2 child processes The parent process reads the ID of the destination process as well as the message itself from the user and sends the message through the correct pipe to its intended destination. The parent, sender process ignores any messages that are destined to neither of the children. As soon as a child process receives a message it prints it to the screen as shown in the sample run below (Figure 2). The parent process will keep on reading messages from the user and sending them to the destination processes until the user types -1 for the ID of the destination. It then closes all open pipes and terminates. Please test for the success of the different system calls you use in your code, and make sure that the parent process waits for its children before it terminates. Your program should behave as follows
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
