/*  fork-zombie.c (Praktikum, Arbeitsblatt 2)

    Vorlesung Betriebssysteme
    Hans-Georg Eßer, Hochschule München
    hans-georg.esser@hm.edu
*/

#include <unistd.h> /* sleep() */
#include <stdio.h>  /* printf() */ 

int main() {
  int pid = fork();
  if (pid == 0)
    { /* Sohn: "Ich will ein Zombie sein" */
      return 0;
    }
  else
    { /* Vater */
      printf ("Ich bin der Vater-Prozess und warte jetzt 20 Sekunden...\n");
      sleep (20);
      wait ();
      return 0;
    }
}

