sigint sigterm sigkill

sigint sigterm都将收到信号。区别在于sigint会对进程树发送信号,因此子进程也会自动退出。(on Unix in most cases the parent and child will share a controlling terminal. Pressing Ctrl+C in the terminal will broadcast SIGINT to all processes, parent and child. )
sigkill不能被程序捕获,因此一旦收到信号,进程退出。子进程无法退出,成为孤儿。

posted @ 2024-03-07 10:57  xuyv  阅读(12)  评论(0编辑  收藏  举报