bionic/libc/private
Elliott Hughes 877ec6d904 Fix pthread_join.
Let the kernel keep pthread_internal_t::tid updated, including
across forks and for the main thread. This then lets us fix
pthread_join to only return after the thread has really exited.

Also fix the thread attributes of the main thread so we don't
unmap the main thread's stack (which is really owned by the
dynamic linker and contains things like environment variables),
which fixes crashes when joining with an exited main thread
and also fixes problems reported publicly with accessing environment
variables after the main thread exits (for which I've added a new
unit test).

In passing I also fixed a bug where if the clone(2) inside
pthread_create(3) fails, we'd unmap the child's stack and TLS (which
contains the mutex) and then try to unlock the mutex. Boom! It wasn't
until after I'd uploaded the fix for this that I came across a new
public bug reporting this exact failure.

Bug: 8206355
Bug: 11693195
Bug: https://code.google.com/p/android/issues/detail?id=57421
Bug: https://code.google.com/p/android/issues/detail?id=62392
Change-Id: I2af9cf6e8ae510a67256ad93cad891794ed0580b
2013-11-18 19:48:11 -08:00
..
__get_tls.h Fix __errno for LP64 and clean up __get_tls. 2013-10-09 13:39:13 -07:00
arpa_nameser_compat.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
arpa_nameser.h Fix x86_64 build, clean up intermediate libraries. 2013-10-09 16:00:17 -07:00
bionic_asm.h Stop using the non-uapi <linux/err.h> header file. 2013-11-07 10:31:05 -08:00
bionic_atomic_arm.h bionic_atomic_arm.h: Remove < ARMv6 support 2013-07-03 14:14:06 -07:00
bionic_atomic_gcc_builtin.h Fix implementation of generic atomic operations 2012-07-24 13:56:38 -07:00
bionic_atomic_inline.h Report errors to the log, not just stderr. 2012-07-27 17:43:38 -07:00
bionic_atomic_mips.h [MIPS] Add atomic routines 2012-07-24 10:30:22 -07:00
bionic_atomic_x86.h bionic: Do not use <sys/atomics.h> for platform code. 2011-11-16 16:28:10 +01:00
bionic_auxv.h Remove 32-bit assumptions from the ELF code. 2013-09-30 18:43:46 -07:00
bionic_futex.h Fix pthread_join. 2013-11-18 19:48:11 -08:00
bionic_pthread.h <pthread.h> fixes and pthread cleanup. 2013-10-31 12:31:16 -07:00
bionic_ssp.h Simplify __stack_chk_fail, and fix it so we get debuggerd stack traces. 2013-02-14 14:37:34 -08:00
bionic_time_conversions.h Remove dependencies on obsolete __ARCH_WANT_SYSCALL_DEPRECATED system calls. 2013-10-24 15:48:32 -07:00
bionic_time.h Ensure header files using __BEGIN_DECLS include sys/cdefs.h. 2013-06-05 17:58:08 -07:00
bionic_tls.h Fix pthread_join. 2013-11-18 19:48:11 -08:00
ErrnoRestorer.h Revert "Revert "More pthreads cleanup."" 2013-02-12 15:27:18 -08:00
kernel_sigset_t.h Remove dependencies on obsolete __ARCH_WANT_SYSCALL_DEPRECATED system calls. 2013-10-24 15:48:32 -07:00
KernelArgumentBlock.h Remove 32-bit assumptions from the ELF code. 2013-09-30 18:43:46 -07:00
libc_events.h Optimize __memset_chk, __memcpy_chk. DO NOT MERGE. 2013-08-14 18:14:43 -07:00
libc_logging.h Optimize __memset_chk, __memcpy_chk. DO NOT MERGE. 2013-08-14 18:14:43 -07:00
nsswitch.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
resolv_cache.h resolv_cache: hide some libc private functions 2013-03-29 13:56:05 -07:00
resolv_iface.h dns cache per interface iteration 2 2013-02-07 09:40:16 -08:00
resolv_private.h am 87b4286f: Merge "Expose dn_comp and dn_expand to system C code." 2013-07-02 16:02:30 -07:00
resolv_static.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ScopedPthreadMutexLocker.h Fix dlerror(3). 2012-10-11 16:08:51 -07:00
ScopedReaddir.h Reimplement scandir(3). 2013-02-25 13:14:31 -08:00
thread_private.h Clean up useless declaration in thread_private.h 2013-06-05 11:26:24 +08:00
ThreadLocalBuffer.h Revert "Revert "More pthreads cleanup."" 2013-02-12 15:27:18 -08:00