Equivalent of ctrl c in command to cancel a program

前端 未结 6 1993
渐次进展
渐次进展 2020-12-24 00:29

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

6条回答
  •  无人及你
    2020-12-24 00:50

    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.

提交回复
热议问题