NODE e6aab878I am looking for a way to create a zombie process
fc@all.net (Dr. Frederick B. Cohen)Sun, 15 Oct 95 08:59:06 PDT
I am writing a paper that, among other things, talks about detecting
zombie processes. I find that, due to my systematic hunting down and
eliminating of these processes, I no longer have any hanging around for
demonstration purposes. How embarassing - I don't know how to create
one!
Is there anyone who can give me a simple program or set of commands that
creates a zombie process? Thanks in advance.
--
-> See: Info-Sec Heaven at URL http://all.net
Management Analytics - 216-686-0090 - PO Box 1480, Hudson, OH 44236
NODE a0c93d12Re: I am looking for a way to create a zombie process
shields@tembel.org (Michael Shields)Sun, 15 Oct 95 10:41:54 PDT
> 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.
NODE c1e58414Re: I am looking for a way to create a zombie process
iagoldbe@csclub.uwaterloo.ca (Ian Goldberg)Sun, 15 Oct 95 16:48:39 PDT
In article <m0t4X3e-000DgnC@yage.tembel.org>,
Michael Shields <shields@tembel.org> wrote:
>> 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.
>
<snip>
> wait();
<snip>
wait(NULL); would be saner.
- Ian