bonic: libc: cpuacct support for setuid functions
Any of the setuid functions now updates /acct/uid/ with its own tid
before changing users. This is so we can properly account for cpu time
per uid.
Change-Id: I34186cf4d5228cac8439e582a9e26c01ef3011e4
Signed-off-by: Mike Chan <mike@android.com>
diff --git a/libc/unistd/seteuid.c b/libc/unistd/seteuid.c
index 42ee780..dd94932 100644
--- a/libc/unistd/seteuid.c
+++ b/libc/unistd/seteuid.c
@@ -29,5 +29,6 @@
int seteuid(uid_t euid)
{
- return setresuid(-1, euid,-1);
+ cpuacct_add(euid);
+ return __setresuid(-1, euid,-1);
}