5
kill -s SIGCHLD
위의 코드는 좀비 프로세스를 죽이는 코드이지만 내 질문은 다음과 같습니다.
좀비 프로세스 자체가 표시되는 방법이 있습니까?좀비 프로세스가 어떻게 나타 납니까?
kill -s SIGCHLD
위의 코드는 좀비 프로세스를 죽이는 코드이지만 내 질문은 다음과 같습니다.
좀비 프로세스 자체가 표시되는 방법이 있습니까?좀비 프로세스가 어떻게 나타 납니까?
steenhulthin은 정확하지만 이동하기 전까지 누군가가 대답 할 수 있습니다. 자식 프로세스가 종료되는 시간과 부모가 종료 상태를 얻기 위해 wait()
함수 중 하나를 호출하는 시간 사이에 좀비 프로세스가 존재합니다.
간단한 예 :
/* Simple example that creates a zombie process. */
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int main(void)
{
pid_t cpid;
char s[4];
int status;
cpid = fork();
if (cpid == -1) {
puts("Whoops, no child process, bye.");
return 1;
}
if (cpid == 0) {
puts("Child process says 'goodbye cruel world.'");
return 0;
}
puts("Parent process now cruelly lets its child exist as\n"
"a zombie until the user presses enter.\n"
"Run 'ps aux | grep mkzombie' in another window to\n"
"see the zombie.");
fgets(s, sizeof(s), stdin);
wait(&status);
return 0;
}
일에 대한에 더 잘 맞는 것 같아 " 잔인하게 그 아이를 존재하게합니다 ... ":) 좋은 대답. –
좋은 질문,하지만 난 그것을 http://unix.stackexchange.com/ 또는 가능 http://askubuntu.com/ – steenhulthin