summaryrefslogtreecommitdiff
path: root/src/user/app/tests/kernel/miscsyscall.c
diff options
context:
space:
mode:
authordzwdz2023-01-08 21:14:03 +0100
committerdzwdz2023-01-08 21:14:03 +0100
commitc178ab5d5ca328d5b0072d54e3dc66d1b198df7b (patch)
tree0f9e3da6fc6133ab4bab052661bf8903e354d804 /src/user/app/tests/kernel/miscsyscall.c
parent5defe97cc8b870fa50ba01999f80974b8b21c5b5 (diff)
kernel: let parents kill their children again
Diffstat (limited to 'src/user/app/tests/kernel/miscsyscall.c')
-rw-r--r--src/user/app/tests/kernel/miscsyscall.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/user/app/tests/kernel/miscsyscall.c b/src/user/app/tests/kernel/miscsyscall.c
index 66899b1..58a9afb 100644
--- a/src/user/app/tests/kernel/miscsyscall.c
+++ b/src/user/app/tests/kernel/miscsyscall.c
@@ -26,6 +26,20 @@ static void test_await(void) {
test(counts[i] == 1);
}
+static void test_await2(void) {
+ /* hangs on failure */
+ if (!fork()) {
+ if (!fork()) {
+ for (;;) _syscall_sleep(1000000000);
+ } else {
+ exit(123);
+ }
+ }
+ test(_syscall_await() == 123);
+ test(_syscall_await() == ~0); /* don't wait for tombstone */
+ _syscall_filicide();
+}
+
static void test_pipe(void) {
const char *pipe_msgs[2] = {"hello", "world"};
handle_t ends[2];
@@ -246,6 +260,7 @@ static void test_sleep(void) {
for (;;) _syscall_sleep(1000000000);
}
_syscall_await();
+ _syscall_filicide();
_syscall_exit(0);
}
@@ -277,6 +292,7 @@ static void test_badopen(void) {
void r_k_miscsyscall(void) {
run_test(test_await);
+ run_test(test_await2);
run_test(test_pipe);
run_test(test_memflag);
run_test(test_dup);