summaryrefslogtreecommitdiff
path: root/user/zombie.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2019-06-11 09:57:14 -0400
committerRobert Morris <[email protected]>2019-06-11 09:57:14 -0400
commit5753553213df8f9de851adb68377db43faecb91f (patch)
tree3b629ff54897fca414146677532cb459a2ed11ba /user/zombie.c
parent91ba81110acd3163f7de3580b677eece0c57f5e7 (diff)
downloadxv6-labs-5753553213df8f9de851adb68377db43faecb91f.tar.gz
xv6-labs-5753553213df8f9de851adb68377db43faecb91f.tar.bz2
xv6-labs-5753553213df8f9de851adb68377db43faecb91f.zip
separate source into kernel/ user/ mkfs/
Diffstat (limited to 'user/zombie.c')
-rw-r--r--user/zombie.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/user/zombie.c b/user/zombie.c
new file mode 100644
index 0000000..b56231a
--- /dev/null
+++ b/user/zombie.c
@@ -0,0 +1,14 @@
+// Create a zombie process that
+// must be reparented at exit.
+
+#include "kernel/types.h"
+#include "kernel/stat.h"
+#include "user/user.h"
+
+int
+main(void)
+{
+ if(fork() > 0)
+ sleep(5); // Let child exit before parent.
+ exit();
+}