aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/testfork.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib9/testfork.c')
-rw-r--r--src/lib9/testfork.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib9/testfork.c b/src/lib9/testfork.c
new file mode 100644
index 00000000..a5e63718
--- /dev/null
+++ b/src/lib9/testfork.c
@@ -0,0 +1,21 @@
+#include <lib9.h>
+
+void
+sayhi(void *v)
+{
+ USED(v);
+
+ print("hello from subproc\n");
+ print("rendez got %lu from main\n", rendezvous(0x1234, 1234));
+ exits(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ print("hello from main\n");
+ ffork(RFMEM|RFPROC, sayhi, nil);
+
+ print("rendez got %lu from subproc\n", rendezvous(0x1234, 0));
+ exits(0);
+}