summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2016-07-13 09:38:39 -0500
committerMark Salyzyn2016-07-14 09:34:53 -0500
commitec4f5c776d2bde026e2a74128218924be7b3f46a (patch)
treec938befe02e59834eb079dea7153c7eaad48ae98 /liblog/logger.h
parent4c06cd86347aa85c9e5999ad5f5ca20ef5f4ac8e (diff)
downloadplatform-system-core-ec4f5c776d2bde026e2a74128218924be7b3f46a.tar.gz
platform-system-core-ec4f5c776d2bde026e2a74128218924be7b3f46a.tar.xz
platform-system-core-ec4f5c776d2bde026e2a74128218924be7b3f46a.zip
liblog: reset pid and uid cache after a vfork()
Bionic getuid() and getpid() calls cache to reduce the need to perform a syscall, and also reset their own cache after a vfork(). No more need for liblog to be performing this flawed cache operation. Bug: 30085794 Change-Id: I70feed8bff0ddd919c2885a348ba67b14ddc0e0d
Diffstat (limited to 'liblog/logger.h')
-rw-r--r--liblog/logger.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/liblog/logger.h b/liblog/logger.h
index 508725610..2a4cfcb56 100644
--- a/liblog/logger.h
+++ b/liblog/logger.h
@@ -146,11 +146,13 @@ struct android_log_transport_context {
146/* OS specific dribs and drabs */ 146/* OS specific dribs and drabs */
147 147
148#if defined(_WIN32) 148#if defined(_WIN32)
149#include <private/android_filesystem_config.h>
149typedef uint32_t uid_t; 150typedef uint32_t uid_t;
151static inline uid_t __android_log_uid() { return AID_SYSTEM; }
152#else
153static inline uid_t __android_log_uid() { return getuid(); }
150#endif 154#endif
151 155
152LIBLOG_HIDDEN uid_t __android_log_uid();
153LIBLOG_HIDDEN pid_t __android_log_pid();
154LIBLOG_HIDDEN void __android_log_lock(); 156LIBLOG_HIDDEN void __android_log_lock();
155LIBLOG_HIDDEN int __android_log_trylock(); 157LIBLOG_HIDDEN int __android_log_trylock();
156LIBLOG_HIDDEN void __android_log_unlock(); 158LIBLOG_HIDDEN void __android_log_unlock();