Does anybody know an equivalent of the Windows SetConsoleCtrlHandler function for Linux/UNIX OS? (Specifically, for a wxWidgets application.)
Does anybody know an equivalent of the Windows SetConsoleCtrlHandler function for Linux/UNIX OS? (Specifically,
Share
You can use the ‘signal()’ function.
Here’s an example:
As mentioned in the comments,
sigaction()avoids some pitfalls that can be common withsignal(), and should be preferred..