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
diff --git a/liblog/logger.h b/liblog/logger.h
index 5087256..2a4cfcb 100644
--- a/liblog/logger.h
+++ b/liblog/logger.h
@@ -146,11 +146,13 @@
/* OS specific dribs and drabs */
#if defined(_WIN32)
+#include <private/android_filesystem_config.h>
typedef uint32_t uid_t;
+static inline uid_t __android_log_uid() { return AID_SYSTEM; }
+#else
+static inline uid_t __android_log_uid() { return getuid(); }
#endif
-LIBLOG_HIDDEN uid_t __android_log_uid();
-LIBLOG_HIDDEN pid_t __android_log_pid();
LIBLOG_HIDDEN void __android_log_lock();
LIBLOG_HIDDEN int __android_log_trylock();
LIBLOG_HIDDEN void __android_log_unlock();