Does anybody know an equivalent of the Windows SetConsoleCtrlHandler
function for Linux/UNIX OS? (Specifically, for a wxWidgets application.)
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
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..