Question: Write a C program which will have to create a child process. Then you must use ordinary pipe ( s ) to implement a half
Write a C program which will have to create a child process. Then you must use ordinary
pipes to implement a halfduplex communication between the parent process and the
child process where both processes can exchange messages.
To test your program the parent and child will exchange some messages, the parent will start
first by sending the first message, then the child will respond Messages should get
exchanged through pipes, and each message received from both parties should get displayed
on the screen. A delay of seconds should be added between each consecutive message
display you can use the sleep function for this
The output of your program should look exactly like this in total exchanges of messages
between Parent and Child processes:
"Greetings son
Hello dad
How are you son
Fine dad thanks"
You should implement one read and one write buffers to send and to receive messages eg
char writemsgBUFFERSIZE;
char readmsgBUFFERSIZE;
Buffers declaration should be done in the main function first two line right after
main; Use strcpy function; to assignupdate a message in a buffer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
