📜  收割僵尸进程 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:39.560000             🧑  作者: Mango

代码示例1
void delete_zombies(void)
{
    pid_t kidpid;
    int status;

    printf("Inside zombie deleter:  ");
    while ((kidpid = waitpid(-1, &status, WNOHANG)) > 0)
    {
         printf("Child %ld terminated\n", kidpid);
    }
    siglongjmp(env,1);
}