comparison uprogs/zombie.c @ 0:c450faca55f4

Init
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Sun, 22 Oct 2017 18:25:39 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c450faca55f4
1 // Create a zombie process that
2 // must be reparented at exit.
3
4 #include "types.h"
5 #include "stat.h"
6 #include "user.h"
7
8 int
9 main(void)
10 {
11 if(fork() > 0){
12 sleep(5); // Let child exit before parent.
13 printf(2, "Parent exits!\n");
14 exit();
15 }
16 printf(2, "Child exits!\n");
17 exit();
18 }