We know that in the world of Linux-Unix, we can break the program running in the foreground in the terminal with ctrl+C and end the program.
How can I know in C++ that a third party breaks or forces kill (kill -9
) the program?
Do I have to check something with the thread constantly? I have to return exit status 130 in my program when the program is broken and 140 exit status when the program is killed.