summaryrefslogtreecommitdiffstats
path: root/libc/bionic/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/bionic/fork.c')
-rw-r--r--libc/bionic/fork.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/bionic/fork.c b/libc/bionic/fork.c
index 1c6a4ba..e20f548 100644
--- a/libc/bionic/fork.c
+++ b/libc/bionic/fork.c
@@ -43,6 +43,14 @@ int fork(void)
ret = __fork();
if (ret != 0) { /* not a child process */
__timer_table_start_stop(0);
+ } else {
+ /*
+ * Newly created process must update cpu accounting.
+ * Call cpuacct_add passing in our uid, which will take
+ * the current task id and add it to the uid group passed
+ * as a parameter.
+ */
+ cpuacct_add(getuid());
}
return ret;
}