Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Goal Practice process creation and communication in UNLX using fork ( ) and pipo ( ) system calls. Reference: the textbook chapter 3 ( Processes

Goal
Practice process creation and communication in UNLX using fork() and pipo() system
calls.
Reference: the textbook chapter 3(Processes)
Description
Please read the complete assignment document carefally before starting.
Write a C program which will have to create a child process. Then you must use ordinary
pipe(s) to implement a half-duplex 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 meseages, 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 fiom both parties should get displayed
on the screen. A delay of 2 seconds should be added between each consecutive meseage
display (you can wese the s1eep () function for this).
The output of your program should look exactly like this (in total 4 exchanges of messages
between Parent and Child processes):
Greetings son
Hello dad
How are you son
Fine dad thanks
... Program finished with exit code 0
Pxess ENTER to exit console-
You should implement one read and one write buffers to send and to receive messages e.g-
char Ur1te nsg [BUEEER. SIZE];
char read_nsg[RUFEER_SIZE];
Buffers declaration shoald be done in the na in () function (first two line right after
main () ks Use st rcpy () function; to assign/update a message in a buffer.
Background information:
Use the program in Figure 3.7.6c Ordinary pipe in UNLX in the textbook as your starting
tensplate (slide 71 in ch 3 lecture on BS).3.7 Ordinary Pipes - The complete C code in UNIX
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions