17 Dec
2003
17 Dec
'03
11:17 p.m.
Is there anyone who can give me a simple program or set of commands that creates a zombie process? Thanks in advance.
Here, public domain. #include <stdio.h> #include <unistd.h> int main() { if (!fork()) { /* Child; die. */ exit(0); } else { /* Child dies, is zombie for ten seconds. */ sleep(10); /* Reap it. */ wait(); /* Now no zombie. */ sleep(10); exit(0); } } -- Shields.