Due: Wednesday 11/10 8:00 am
GitHub Submission Link: git@github.com:mks65/14_signal.git
Write a C program with the following features:
- Runs constantly inside a forever while loop.
- Print out the process’ PID inside the loop.
- Use the
sleep(1)
function to have the program wait 1 second between inner loop iterations.
- Catch the following signals
SIGINT
- Before exiting, append a message to a file noting that the program exited due to SIGINT
- To make your program quit, look up the
exit
function.
SIGUSR1
- Print out the PID of the parent process.
- Should not cause the program to exit.