Reduce namespace pollution.
This leaves us with just the mspace stuff and three libdex functions to clean
up. We deliberately expose the JII API, and I don't think there's anything we
can really do about the art_..._from_code stuff (and at least that starts with
"art_").
Change-Id: I77e58e8330cd2afeb496642302dfe3311e68091a
diff --git a/src/utils.cc b/src/utils.cc
index cc0a702..d4d2e3a 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -24,23 +24,22 @@
#include <sys/prctl.h>
#endif
-#if defined(__APPLE__)
-// Mac OS doesn't have gettid(2).
-pid_t gettid() { return getpid(); }
-#else
-// Neither bionic nor glibc exposes gettid(2).
-#define __KERNEL__
+#if defined(__linux__)
#include <linux/unistd.h>
-#ifdef _syscall0
-_syscall0(pid_t, gettid)
-#else
-pid_t gettid() { return syscall(__NR_gettid); }
-#endif
-#undef __KERNEL__
#endif
namespace art {
+pid_t GetTid() {
+#if defined(__APPLE__)
+ // Mac OS doesn't have gettid(2).
+ return getpid();
+#else
+ // Neither bionic nor glibc exposes gettid(2).
+ return syscall(__NR_gettid);
+#endif
+}
+
bool ReadFileToString(const std::string& file_name, std::string* result) {
UniquePtr<File> file(OS::OpenFile(file_name.c_str(), false));
if (file.get() == NULL) {
@@ -665,8 +664,4 @@
return (suffix == ".dex");
}
-pid_t GetTid() {
- return gettid();
-}
-
} // namespace art