am 55b4c8a4
: Merge "Hide the __bionic_clone and __bionic_clone_entry implementation details."
* commit '55b4c8a4a15723f7c5f68b9ab167fbdea0c4e610': Hide the __bionic_clone and __bionic_clone_entry implementation details.
This commit is contained in:
commit
df3aa079cc
@ -71,3 +71,4 @@ ENTRY(__bionic_clone)
|
||||
ldr r1, [sp, #-8]
|
||||
b __bionic_clone_entry
|
||||
END(__bionic_clone)
|
||||
.hidden __bionic_clone
|
||||
|
@ -61,3 +61,4 @@ ENTRY(__bionic_clone)
|
||||
ldp x0, x1, [sp, #-16]
|
||||
b __bionic_clone_entry
|
||||
END(__bionic_clone)
|
||||
.hidden __bionic_clone
|
||||
|
@ -66,3 +66,4 @@ ENTRY(__bionic_clone)
|
||||
la t9,__set_errno
|
||||
j t9
|
||||
END(__bionic_clone)
|
||||
.hidden __bionic_clone
|
||||
|
@ -95,3 +95,4 @@ LEAF(__bionic_clone, FRAMESZ)
|
||||
PTR_ADDU sp,FRAMESZ
|
||||
j t9
|
||||
END(__bionic_clone)
|
||||
.hidden __bionic_clone
|
||||
|
@ -51,3 +51,4 @@ bc_return:
|
||||
popl %ebx
|
||||
ret
|
||||
END(__bionic_clone)
|
||||
.hidden __bionic_clone
|
||||
|
@ -70,3 +70,4 @@ ENTRY(__bionic_clone)
|
||||
2:
|
||||
ret
|
||||
END(__bionic_clone)
|
||||
.hidden __bionic_clone
|
||||
|
@ -35,7 +35,7 @@ extern "C" pid_t __bionic_clone(uint32_t flags, void* child_stack, int* parent_t
|
||||
extern "C" void __exit(int status);
|
||||
|
||||
// Called from the __bionic_clone assembler to call the thread function then exit.
|
||||
extern "C" void __bionic_clone_entry(int (*fn)(void*), void* arg) {
|
||||
extern "C" __LIBC_HIDDEN__ void __bionic_clone_entry(int (*fn)(void*), void* arg) {
|
||||
int status = (*fn)(arg);
|
||||
__exit(status);
|
||||
}
|
||||
|
@ -256,22 +256,6 @@ TEST(pthread, pthread_sigmask) {
|
||||
ASSERT_EQ(0, pthread_sigmask(SIG_SETMASK, &original_set, NULL));
|
||||
}
|
||||
|
||||
#if defined(__BIONIC__)
|
||||
extern "C" pid_t __bionic_clone(int flags, void* child_stack, pid_t* parent_tid, void* tls, pid_t* child_tid, int (*fn)(void*), void* arg);
|
||||
#endif // __BIONIC__
|
||||
|
||||
TEST(pthread, __bionic_clone) {
|
||||
#if defined(__BIONIC__)
|
||||
// Check that our hand-written clone assembler sets errno correctly on failure.
|
||||
uintptr_t fake_child_stack[16];
|
||||
errno = 0;
|
||||
ASSERT_EQ(-1, __bionic_clone(CLONE_THREAD, &fake_child_stack[16], NULL, NULL, NULL, NULL, NULL));
|
||||
ASSERT_EQ(EINVAL, errno);
|
||||
#else // __BIONIC__
|
||||
GTEST_LOG_(INFO) << "This test does nothing.\n";
|
||||
#endif // __BIONIC__
|
||||
}
|
||||
|
||||
TEST(pthread, pthread_setname_np__too_long) {
|
||||
#if defined(__BIONIC__) // Not all build servers have a new enough glibc? TODO: remove when they're on gprecise.
|
||||
ASSERT_EQ(ERANGE, pthread_setname_np(pthread_self(), "this name is far too long for linux"));
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user