aboutsummaryrefslogtreecommitdiffstats
path: root/tests/sched_test.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-08 19:00:23 -0700
committerElliott Hughes <enh@google.com>2014-05-08 19:00:23 -0700
commit954cf0d4e2669f91194b45f484152e47efa4f6c7 (patch)
treea367f6590dcf1723983c7396a63bb6174b94b8e9 /tests/sched_test.cpp
parent170daa042cb0ef3e5d7839f79d052a683b3c670f (diff)
downloadandroid_bionic-954cf0d4e2669f91194b45f484152e47efa4f6c7.tar.gz
android_bionic-954cf0d4e2669f91194b45f484152e47efa4f6c7.tar.bz2
android_bionic-954cf0d4e2669f91194b45f484152e47efa4f6c7.zip
Hide the __bionic_clone and __bionic_clone_entry implementation details.
clone(2) is the public symbol. Also switch a test from __bionic_clone to clone; testing public API means the test now works on glibc too. Change-Id: If59def26a00c3afadb8a6cf9442094c35a59ffde
Diffstat (limited to 'tests/sched_test.cpp')
-rw-r--r--tests/sched_test.cpp8
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;