android_bionic/libc/bionic
Rabin Vincent 177ba8cb42 Prevent deadlock when using fork
When forking of a new process in bionic, it is critical that it
does not allocate any memory according to the comment in
java_lang_ProcessManager.c:
"Note: We cannot malloc() or free() after this point!
A no-longer-running thread may be holding on to the heap lock, and
an attempt to malloc() or free() would result in deadlock."
However, as fork is using standard lib calls when tracing it a bit,
they might allocate memory, and thus causing the deadlock.
This is a rewrite so that the function cpuacct_add, that fork calls,
will use system calls instead of standard lib calls.

Signed-off-by: christian bejram <christian.bejram@stericsson.com>

Change-Id: Iff22ea6b424ce9f9bf0ac8e9c76593f689e0cc86
2011-12-06 08:39:18 -08:00
..
__errno.c
__set_errno.c
arc4random.c
atomics_x86.c
basename.c
basename_r.c
bionic_clone.c
clearenv.c
cpuacct.c Prevent deadlock when using fork 2011-12-06 08:39:18 -08:00
dirname.c
dirname_r.c
dlmalloc.c Revert "Revert "libc: Add logcat error message for memory corruption"" 2011-07-06 12:58:56 -07:00
dlmalloc.h
drand48.c Remove duplicated _rand48 implementation. Use stdlib version instead 2010-10-25 16:27:47 -07:00
erand48.c Remove duplicated _rand48 implementation. Use stdlib version instead 2010-10-25 16:27:47 -07:00
err.c
fdprintf.c
fork.c
fts.c
hash.h
if_indextoname.c
if_nametoindex.c
ioctl.c
ldexp.c
libc_init_common.c am 1df986c2: libc: fix executable destruction support. 2010-10-21 09:43:19 -07:00
libc_init_common.h Updated gcc 4.4.3 IA toolchain doesn't require the .ctors list 2011-07-07 22:46:16 +02:00
libc_init_dynamic.c am 1df986c2: libc: fix executable destruction support. 2010-10-21 09:43:19 -07:00
libc_init_static.c Updated gcc 4.4.3 IA toolchain doesn't require the .ctors list 2011-07-07 22:46:16 +02:00
logd_write.c Revert "Revert "libc: Add logcat error message for memory corruption"" 2011-07-06 12:58:56 -07:00
malloc_debug_common.c removing shadowing redeclaration of result 2011-03-22 15:35:40 +01:00
malloc_debug_common.h
malloc_debug_leak.c MALLOC_DEBUG: enable the option libc.debug.malloc = 10 2011-12-05 14:58:55 -08:00
malloc_debug_qemu.c
md5.c am 08a4ce98: am 0c398985: Merge "[ENDIAN] Build md5 code correctly for bigendian targets" 2011-03-14 11:50:56 -07:00
md5.h
memmove_words.c Add some missing includes. 2011-03-21 20:01:03 -07:00
pthread-atfork.c
pthread-rwlocks.c
pthread-timers.c
pthread.c signal: Align the sigset_t size passed to from user space to kernel. 2011-12-05 18:37:33 -08:00
pthread_internal.h
ptrace.c bionic, libthread_db x86 fixes 2011-07-07 22:46:16 +02:00
pututline.c
realpath.c Use a modern chdir(2)-free realpath(3) implementation. 2010-11-04 17:53:06 -07:00
rules.jam
sched_cpualloc.c <sched.h>: Add sched_getcpu() and cpu_set_t 2010-12-06 13:42:54 +01:00
sched_cpucount.c <sched.h>: Add sched_getcpu() and cpu_set_t 2010-12-06 13:42:54 +01:00
sched_getaffinity.c <sched.h>: Add sched_getcpu() and cpu_set_t 2010-12-06 13:42:54 +01:00
sched_getcpu.c <sched.h>: Add sched_getcpu() and cpu_set_t 2010-12-06 13:42:54 +01:00
semaphore.c
sha1.c
ssp.c
stubs.c Implement getpwnam_r(3) and getpwuid_r(3). 2011-05-27 00:52:21 -07:00
system_properties.c Ignore property set timeouts. 2011-04-01 10:53:12 -07:00
thread_atexit.c
time64.c
time64_config.h <time.h>: Add timegm(), timelocal() and others. 2010-12-06 12:25:52 +01:00
utime.c
utmp.c