platform_bionic/tests
Elliott Hughes 7086ad6919 Cache getpid.
In practice, with this implementation we never need to make a system call.
We get the main thread's tid (which is the same as our pid) back from
the set_tid_address system call we have to make during initialization.
A new pthread will have the same pid as its parent, and a fork child's
main (and only) thread will have a pid equal to its tid, which we get for
free from the kernel before clone returns.

The only time we'd actually have to make a getpid system call now is if
we take a signal during fork and the signal handler calls getpid. (That,
or we call getpid in the dynamic linker while it's still dealing with its
own relocations and hasn't even set up the main thread yet.)

Bug: 15387103
Change-Id: I6d4718ed0a5c912fc75b5f738c49a023dbed5189
2014-06-20 09:06:57 -07:00
..
libs Fix weak function lookups 2014-06-17 16:18:18 -07:00
Android.build.mk Move libraries for unit-tests to separate folder 2014-06-17 15:08:53 -07:00
Android.mk Move libraries for unit-tests to separate folder 2014-06-17 15:08:53 -07:00
arpa_inet_test.cpp Use the NetBSD inet_ntop until the OpenBSD bug is fixed. 2014-05-13 19:17:46 -07:00
atexit_test.cpp Make atexit.dlclose work for glibc 2014-05-30 18:16:09 -07:00
buffer_tests.cpp Add strcmp/memcmp testing. 2013-12-03 18:42:41 -08:00
buffer_tests.h Add strcmp/memcmp testing. 2013-12-03 18:42:41 -08:00
ctype_test.cpp Upgrade our <ctype.h> implementation to OpenBSD head. 2014-04-18 10:29:16 -07:00
dirent_test.cpp Implement some of the missing LFS64 support. 2014-02-18 15:39:24 -08:00
dlext_test.cpp Test that relro sharing actually saves memory. 2014-05-06 11:38:53 +01:00
dlfcn_test.cpp Fix weak function lookups 2014-06-17 16:18:18 -07:00
eventfd_test.cpp Make sure that the same tests are on all platforms. 2014-02-06 20:12:21 -08:00
fcntl_test.cpp Consistently use #if defined(__BIONIC__) in tests. 2014-05-13 11:19:57 -07:00
fenv_test.cpp Upgrade libm. 2013-02-01 14:51:19 -08:00
fortify_test.cpp Consistently use #if defined(__BIONIC__) in tests. 2014-05-13 11:19:57 -07:00
ftw_test.cpp Added ftw64, nftw64 2014-02-24 20:22:11 +00:00
getauxval_test.cpp Make sure that the same tests are on all platforms. 2014-02-06 20:12:21 -08:00
getcwd_test.cpp Fix __pthread_clone on ARM to set errno on failure. 2013-02-11 16:39:10 -08:00
inttypes_test.cpp Switch to the OpenBSD implementations of the wide scanf functions. 2014-04-29 16:28:56 -07:00
libc_logging_test.cpp Make sure that the same tests are on all platforms. 2014-02-06 20:12:21 -08:00
libgen_test.cpp Make sure that the same tests are on all platforms. 2014-02-06 20:12:21 -08:00
locale_test.cpp Consistently use #if defined(__BIONIC__) in tests. 2014-05-13 11:19:57 -07:00
malloc_test.cpp Use a separate config.h for config like defines. 2014-06-16 23:35:53 -07:00
math_cos_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_cosf_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_exp_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_expf_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_log_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_logf_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_pow_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_powf_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_sin_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_sincos_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_sincosf_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_sinf_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_tan_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_tanf_test.cpp Accuracy tests for libm 2014-05-16 15:31:55 -07:00
math_test.cpp Add a regression test for two libm bugs we didn't have. 2014-06-06 21:55:27 -07:00
mntent_test.cpp Add getmntent_r to our collection of <mntent.h> compatibility stubs. 2014-05-13 10:44:07 -07:00
netdb_test.cpp Update getnameinfo.c, remove dead code, and fix error reporting. 2013-02-13 13:11:11 -08:00
pthread_test.cpp Cleaned up pthread rwlocks implementation. 2014-05-23 00:22:58 +01:00
regex_test.cpp Consistently use #if defined(__BIONIC__) in tests. 2014-05-13 11:19:57 -07:00
sched_test.cpp Consistently use #if defined(__BIONIC__) in tests. 2014-05-13 11:19:57 -07:00
ScopedSignalHandler.h Fix up failing glibc tests. 2013-10-29 14:55:11 -07:00
signal_test.cpp Switch to g_ for globals. 2014-05-14 10:02:03 -07:00
sstream_test.cpp Improve the <sstream> test. 2014-04-10 20:44:27 -07:00
stack_protector_test.cpp Make sure that the same tests are on all platforms. 2014-02-06 20:12:21 -08:00
stack_unwinding_test.cpp Make sure that the same tests are on all platforms. 2014-02-06 20:12:21 -08:00
stack_unwinding_test_impl.c Fix clang warnings in bionic. 2013-10-11 16:20:08 -07:00
stdatomic_test.cpp Fixes stdatomic.h test to match C11 spec 2014-05-28 16:53:08 -07:00
stdint_test.cpp Fixed int fast types for LP64 2014-02-21 16:27:21 +00:00
stdio_test.cpp Remove declaration for putw(3)/getw(3). 2014-06-11 14:41:45 -07:00
stdlib_test.cpp Get the full set of PRNG functions in <stdlib.h> 2014-06-12 14:37:31 -07:00
string_test.cpp Revert "Backing this one out since the counterpart needs to be sent upstream." 2014-06-14 01:04:31 +00:00
strings_test.cpp Everyone has CLZ. 2013-02-13 14:40:48 -08:00
stubs_test.cpp Align struct passwd definition with other variations of libc 2014-05-09 22:29:23 +01:00
sys_epoll_test.cpp bionic: make epoll_event structure packed 2014-05-05 19:48:55 -07:00
sys_mman_test.cpp Add/Remove mmap tests. 2014-06-12 13:16:36 -07:00
sys_resource_test.cpp Consistently use #if defined(__BIONIC__) in tests. 2014-05-13 11:19:57 -07:00
sys_select_test.cpp Include sys/types.h and sys/wait.h for waitpid 2014-04-01 17:42:31 -07:00
sys_sendfile_test.cpp Make sure that the same tests are on all platforms. 2014-02-06 20:12:21 -08:00
sys_socket_test.cpp Fix signed vs unsigned comparison. 2014-04-15 15:29:32 -07:00
sys_stat_test.cpp Implement some of the missing LFS64 support. 2014-02-18 15:39:24 -08:00
sys_statvfs_test.cpp Implement some of the missing LFS64 support. 2014-02-18 15:39:24 -08:00
sys_syscall_test.cpp Add a unit test for syscall(2). 2013-11-13 13:14:31 -08:00
sys_time_test.cpp Fix utime/utimes when passed a NULL pointer. 2013-10-28 13:21:06 -07:00
sys_types_test.cpp Fix dev_t (for LP64). 2014-01-03 14:49:37 -08:00
sys_vfs_test.cpp Add missing file from previous change. 2014-02-18 15:48:56 -08:00
system_properties_test.cpp Make sure that the same tests are on all platforms. 2014-02-06 20:12:21 -08:00
TemporaryFile.h Add/Remove mmap tests. 2014-06-12 13:16:36 -07:00
time_test.cpp Don't use so much stack in tzcode. 2014-04-25 21:51:26 -07:00
uchar_test.cpp Fix mbrtoc32 test from tests/uchar_test.cpp for x86. 2014-06-11 15:57:57 -07:00
unistd_test.cpp Cache getpid. 2014-06-20 09:06:57 -07:00
wchar_test.cpp Fix the printf family for non-ASCII. 2014-06-05 23:19:15 -07:00