summaryrefslogtreecommitdiffstats
path: root/src/examples/wait.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/wait.c')
-rw-r--r--src/examples/wait.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/examples/wait.c b/src/examples/wait.c
new file mode 100644
index 0000000..ab0ea90
--- /dev/null
+++ b/src/examples/wait.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#include <syscall.h>
+
+int
+main (int argc, char **argv)
+{
+ printf ("hello\n");
+ if (argc != 1) {
+ int child = exec("wait");
+ printf("%d: %d\n", child, wait(child));
+ }
+ exit(1);
+}