How to create Zombie Process?
<p>I was writing programs to create zombie process (for purpose of learning). </p>

<pre><code>int main(int argc, char *argv[]) {

  int i = ::fork();

  if(i == 0) sleep(30);
  else printf("process %d/%d\n", getpid(), i); 

  return 0;

}
</code></pre>

<p>The above code call <code>fork</code> without <code>waitpid</code> on the child process. However, after launching this code I use <code>ps aux | grep 'Z'</code> trying to find the zombie process. I didn't see anything. The child process appears in the process list and soon after 30 seconds (<code>sleep</code>) it disappeared and I find nothing with status <code>'Z'</code> in the process list. Does this code actually create a zombie process?</p>