var pid = fork() switch (pid) { case <0: println ("fork error") break case 0: println ("child") break default: println ("parent") break }