zombie process can't be killed

前端 未结 6 793
北海茫月
北海茫月 2021-01-02 08:41

Is there a way to kill a zombie process? I\'ve tried calling exit to kill the process and even sending SIGINT signal to the process, but it seems t

6条回答
  •  猫巷女王i
    2021-01-02 09:33

    Zombie processes are already dead, so they cannot be killed, they can only be reaped, which has to be done by their parent process via wait*(). This is usually called the child reaper idiom, in the signal handler for SIGCHLD:

    while (wait*(... WNOHANG ...)) {
        ...
    }
    

提交回复
热议问题