Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C/C++ program called signal-parent.cpp that waits a brief period of time (10 seconds; using the sleep function) to simulate a daemon process initializing

Write a C/C++ program called signal-parent.cpp that waits a brief period of time (10 seconds; using the sleep function) to simulate a daemon process initializing and then waiting for an incoming request.

After this period, the parent process should fork/exec (don't use the system() function call) a child process (call it signal-child.cpp). The parent process should then sleep for a longer period of time (2 minutes).

The parent process should determine when the child process exits. The parent process should report the child's PID and it's return/exit status.

The child process should also sleep for a period of time (30 seconds) to simulate a child process performing some work on behalf of the user. After the child process wakes up, it should simply exit with a value of 53.

At each step, both processes should output an informational message to help us understand what is happening, such as the following: parent: forking child child: going to sleep etc. (This information would typically be written to a log file; you may simply write to stdout.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Explain the different types of marketing strategies.

Answered: 1 week ago

Question

2. Identify and choose outcomes to evaluate a training program.

Answered: 1 week ago

Question

6. Conduct a cost-benefit analysis for a training program.

Answered: 1 week ago