Signals
Learn how to handle signals in C.
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 pressingCtrl+C
.
Get hands-on with 1400+ tech skills courses.