Implemented pthread_atfork()
Change-Id: Ie6c0bf593315d3507b3c4a6c8903a74a1fa053db
diff --git a/libc/bionic/fork.c b/libc/bionic/fork.c
index e20f548..8d3ea4b 100644
--- a/libc/bionic/fork.c
+++ b/libc/bionic/fork.c
@@ -40,9 +40,12 @@
* of error, or in the parent process
*/
__timer_table_start_stop(1);
+ __bionic_atfork_run_prepare();
+
ret = __fork();
if (ret != 0) { /* not a child process */
__timer_table_start_stop(0);
+ __bionic_atfork_run_parent();
} else {
/*
* Newly created process must update cpu accounting.
@@ -51,6 +54,7 @@
* as a parameter.
*/
cpuacct_add(getuid());
+ __bionic_atfork_run_child();
}
return ret;
}