diff options
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/tests/kernel/miscsyscall.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cmd/tests/kernel/miscsyscall.c b/src/cmd/tests/kernel/miscsyscall.c index 3cf3f2e..c7ce9e0 100644 --- a/src/cmd/tests/kernel/miscsyscall.c +++ b/src/cmd/tests/kernel/miscsyscall.c @@ -304,6 +304,24 @@ static void test_timer(void) { } } +static void test_getnull(void) { + hid_t h, h2; + char buf[16]; + + test((h = _sys_getnull(0)) >= 0); + test((h2 = dup(h))); + + test(_sys_read(h, buf, 16, 0) == -ENOSYS); + test(_sys_write(h, buf, 16, 0, 0) == -ENOSYS); + test(_sys_getsize(h) == -ENOSYS); + test(_sys_remove(h) == -ENOSYS); + test(_sys_fs_respond(h, buf, 16, 0) == -EBADF); + test(_sys_mount(h, "/asdf", 5) == -EGENERIC); + + close(h); + close(h2); +} + void r_k_miscsyscall(void) { run_test(test_await); run_test(test_await2); @@ -315,4 +333,5 @@ void r_k_miscsyscall(void) { run_test(test_sleep); run_test(test_badopen); run_test(test_timer); + run_test(test_getnull); } |