Custom signal handler
You can override the default signal handler to IGN (ignore) or a custom handler. This is useful if you would like your program to react for certain kind of signals.
The program below sets the signal handler of SIGINT
to SIG_IGN
. The OS will ignore the signal so it has no response to CTRL-C
.
To define a custom signal handler, you can create a function and set it with signal()
.
Last updated
Was this helpful?