Mercurial > hg > Members > innparusu > xv6_rpi_port
annotate 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 |
rev | line source |
---|---|
0 | 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 } |