aboutsummaryrefslogtreecommitdiff
path: root/tests/ipc-req-exhaustion/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ipc-req-exhaustion/init.c')
-rw-r--r--tests/ipc-req-exhaustion/init.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ipc-req-exhaustion/init.c b/tests/ipc-req-exhaustion/init.c
new file mode 100644
index 0000000..6dd1a04
--- /dev/null
+++ b/tests/ipc-req-exhaustion/init.c
@@ -0,0 +1,27 @@
+#include <common/test.h>
+
+long counter = 0;
+
+START(pid, tid, d0, d1, d2, d3)
+{
+ (void)tid;
+ (void)d0;
+ (void)d1;
+ (void)d2;
+ (void)d3;
+
+ check(pid == 0 || pid == 1, "illegal pid for init");
+ printf("sending ipc req %zd to ourselves\n", counter++);
+ struct sys_ret r = sys_ipc_req4(1, 1, 2, 3, 4);
+ if (r.s) {
+ printf("ran out of stack space at %ld\n", counter);
+ printf("starting to unwind\n");
+ }
+
+ printf("unwinding at %ld\n", counter--);
+
+ /* the final resp0 should fail, since we're back in our root process */
+ sys_ipc_resp0();
+
+ ok();
+}