aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pthread_test.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-02-11 16:36:48 -0800
committerElliott Hughes <enh@google.com>2013-02-11 16:39:10 -0800
commit5e3fc43ddeada547a155c6f561a12ff0b16e02d3 (patch)
tree9becf3a8442387f408f7f9ee73ab06ab7f8865d1 /tests/pthread_test.cpp
parent1fea0f258a45d918fe5ae8e9769f45c0348bd095 (diff)
downloadandroid_bionic-5e3fc43ddeada547a155c6f561a12ff0b16e02d3.tar.gz
android_bionic-5e3fc43ddeada547a155c6f561a12ff0b16e02d3.tar.bz2
android_bionic-5e3fc43ddeada547a155c6f561a12ff0b16e02d3.zip
Fix __pthread_clone on ARM to set errno on failure.
MIPS and x86 appear to have been correct already. (Also fix unit tests that ASSERT_EQ with errno so that the arguments are in the retarded junit order.) Bug: 3461078 Change-Id: I2418ea98927b56e15b4ba9cfec97f5e7094c6291
Diffstat (limited to 'tests/pthread_test.cpp')
-rw-r--r--tests/pthread_test.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index 2cf45f30d..0ccd9484e 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -173,3 +173,13 @@ TEST(pthread, pthread_sigmask) {
ASSERT_EQ(SIGUSR1, received_signal);
ASSERT_EQ(0, reinterpret_cast<int>(join_result));
}
+
+#if !defined(__GLIBC__)
+extern "C" int __pthread_clone(int (*fn)(void*), void* child_stack, int flags, void* arg);
+TEST(pthread, __pthread_clone) {
+ uintptr_t fake_child_stack[16];
+ errno = 0;
+ ASSERT_EQ(-1, __pthread_clone(NULL, &fake_child_stack[0], CLONE_THREAD, NULL));
+ ASSERT_EQ(EINVAL, errno);
+}
+#endif