Aero T.

asked • 07/23/21

Write a program simulating an alarm clock.

Write a program simulating an alarm clock. In the main function, you fork a child process, and the child process sleeps for 5 seconds (the number of seconds is an command line argument, see below for a sample run), after which the child process sends the signal (SIGALRM) to its parent process. The parent process, after forking the child process, pause, upon receiving the SIGALRM signal, process prints out a message “Ding!”.

The following is a sample run $./alarm 5

alarm application running

waiting for alarm to go off

<5 second pause>

Ding! Done!

Patrick B.

I'm interested, but only have cygwin unix emulator and Dev C++, and a shabby one at best, which do not support this type of IPC. The best I can offer is IPC via sockets using Java.
Report

07/23/21

1 Expert Answer

By:

Shanek K. answered • 08/13/21

Tutor
4.7 (74)

Computer Science Professional Tutor

Shanek K.

Feel free to reach out to me if you have any doubts or need more help
Report

08/13/21

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.