diff options
Diffstat (limited to 'tests/threads/accept/nested.zc')
| -rw-r--r-- | tests/threads/accept/nested.zc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/threads/accept/nested.zc b/tests/threads/accept/nested.zc new file mode 100644 index 0000000..e231aad --- /dev/null +++ b/tests/threads/accept/nested.zc @@ -0,0 +1,15 @@ +namespace; +include rt; +unchecked fn main() { + int fd = 0; + let worker = rt.syscall(51, fn() { + int child_fd = 0; + let run_child = fn() { while (1) {} return 0; }; + let child = rt.syscall(51, run_child as word, &child_fd, 0); + int reply = child > 0; rt.syscall(44, fd, &reply, 1); + while (1) {} return 0; + } as word, &fd, 0); + int result; rt.syscall(45, fd, &result, 1); rt.syscall(52, worker, 1, 0); + rt.put_n(result); rt.put_c(' '); rt.put_n(rt.syscall(55, 0, 0, 0)); rt.put_c(' '); + rt.put_n(rt.syscall(55, 1, 0, 0)); rt.put_c(' '); rt.put_n(rt.syscall(55, 2, 0, 0)); rt.put_c(10); return 0; +} |
