summaryrefslogtreecommitdiff
path: root/user/zombie.c
diff options
context:
space:
mode:
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();
+}