I am running a long linux program in a remote machine, and I want to stop it, but my problem is that if I use the kill command then the program will exit without saving resu
Keep in mind as well in your signal handler, that it is like an interrupt handler in that you are very limited as to what you are allowed to do in it without corrupting the rest of your program. The best thing you can do here is set an atomic_t "should_quit" variable.