Well I have weird problem. I can't create a zombie process in my project, but I can do this in other file. There's simple instructions:
int main()
{
if(fork()==0)
printf("Some instructions\n");
else
{
sleep(10);
wait(0);
}
return 0;
}
That simple code create a zombie process for 10 seconds. I'm checking and it actually exists.
But if I copy this code to my program (my own shell), everything executing like before BUT zombie process doesn't exist at all. I don't know what's the difference. It's same code.
Is there a more information I should know about that? Is there a other way to create zombie in simple way?
Try this python script:
Thereafter check zombies:
Or C:
Should work like a charm, like a crystal clear pure Haitian Vodou.