diff options
Diffstat (limited to 'tests/threads/accept/channels.zc')
| -rw-r--r-- | tests/threads/accept/channels.zc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/threads/accept/channels.zc b/tests/threads/accept/channels.zc new file mode 100644 index 0000000..e1e966f --- /dev/null +++ b/tests/threads/accept/channels.zc @@ -0,0 +1,9 @@ +namespace; +include rt; +unchecked fn main() { + int first_fd = 0, second_fd = 0; + let first = rt.syscall(51, fn() { int value; rt.syscall(45, first_fd, &value, 1); return 0; } as word, &first_fd, 0); + let second = rt.syscall(51, fn() { int value = 9; int result = rt.syscall(44, first_fd, &value, 1); rt.syscall(44, second_fd, &result, 1); return 0; } as word, &second_fd, 0); + int result; rt.syscall(45, second_fd, &result, 1); rt.syscall(52, second, 0, 0); + rt.put_n(result); rt.put_c(' '); rt.put_n(rt.syscall(52, first, 1, 0)); rt.put_c(10); return 0; +} |
