A program is nothing without communication. The fork() system call is used to duplicate the process. This is done by communicating with the Operating System. Similarly, we can use the methodology, known as signal, to achieve communication from the Operating System to the program.

Uncustomized signal handling

Example program

📝 Note: RUN the code given below and press Ctrl+C to stop the infinite program. You have to wait for some time after pressing Ctrl+C.

Get hands-on with 1200+ tech skills courses.