I am working on a server program in xcode and I want it to be gracefully closed between debug runs. Basically, the next line does not work
std::signal(SIGKILL, [](int){
printf("got sigkill here!\n");
});
I tried to catch other signals, but so far SIGINT, SIGTERM and SIGABRT did not work. How xcode terminates a program if it prints
Program completed with exit code: 9
to the console?
EDIT
Apparently, SIGKILL cannot be caught, see this wikipedia entry.
Unlike SIGTERM and SIGINT, this signal cannot be caught or ignored, and the receiving process cannot perform any cleaning, receiving this signal
Gleno source
share