Work 10: Fire up the batSIGNAL

posted Nov 8, 2017, 6:36 AM by JonAlf Dyrland-Weaver
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.
github link
https://github.com/mks65/signals.git
Comments