Implemented pthread_atfork()

Change-Id: Ie6c0bf593315d3507b3c4a6c8903a74a1fa053db
This commit is contained in:
Matt Fischer
2010-06-25 14:36:39 -05:00
committed by Jean-Baptiste Queru
parent e73a571fd9
commit 4f086aeb4a
6 changed files with 142 additions and 1 deletions

View File

@@ -40,9 +40,12 @@ int fork(void)
* 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 @@ int fork(void)
* as a parameter.
*/
cpuacct_add(getuid());
__bionic_atfork_run_child();
}
return ret;
}