view uprogs/zombie.c @ 11:0157781eb6c2 default tip

add entry point
author mir3636
date Tue, 25 Dec 2018 19:06:09 +0900
parents c450faca55f4
children
line wrap: on
line source

// Create a zombie process that 
// must be reparented at exit.

#include "types.h"
#include "stat.h"
#include "user.h"

int
main(void)
{
  if(fork() > 0){
    sleep(5);  // Let child exit before parent.
    printf(2, "Parent exits!\n");
    exit();
  }
  printf(2, "Child exits!\n");
  exit();
}