Question
2) Simulate Inter-process Communication Write a C/C++ program to simulate the inter-process communication between a child process and a parent process. You need to modify
2) Simulate Inter-process Communication
Write a C/C++ program to simulate the inter-process communication between a child process and a parent process. You need to modify the program you wrote in the procedure 1). In your program:
First, use pipe() to generate a buffer. The pipe should return a status (int), which should be tested to see if it is successful. If not, print error message.
Create a child process.
If the process creation is successful, send a short message (a character string) from child process by using write() to the pipe. In the parent process, use read() to receive the string from the child.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started