diff options
Diffstat (limited to 'tests/sched_test.cpp')
-rw-r--r-- | tests/sched_test.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/sched_test.cpp b/tests/sched_test.cpp index 8dba94886..7c1996257 100644 --- a/tests/sched_test.cpp +++ b/tests/sched_test.cpp @@ -51,6 +51,14 @@ TEST(sched, clone) { } #endif +TEST(sched, clone_errno) { + // Check that our hand-written clone assembler sets errno correctly on failure. + uintptr_t fake_child_stack[16]; + errno = 0; + ASSERT_EQ(-1, clone(NULL, &fake_child_stack[16], CLONE_THREAD, NULL)); + ASSERT_EQ(EINVAL, errno); +} + TEST(sched, cpu_set) { cpu_set_t set; |