blob: acf56e1ece3fdbeff1f8b9435fd8aa924afd4323 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
diff --git a/tools/profiler/core/platform.h b/tools/profiler/core/platform.h
index 5f0fb69..086a511 100644
--- a/tools/profiler/core/platform.h
+++ b/tools/profiler/core/platform.h
@@ -42,10 +42,11 @@
#include "PlatformMacros.h"
#include <vector>
-// We need a definition of gettid(), but glibc doesn't provide a
-// wrapper for it.
-#if defined(__GLIBC__)
+// We need a definition of gettid(), but Linux libc implementations don't
+// provide a wrapper for it (except for Bionic)
+#if defined(__linux__)
#include <unistd.h>
+#if !defined(__BIONIC__)
#include <sys/syscall.h>
static inline pid_t gettid() { return (pid_t)syscall(SYS_gettid); }
#elif defined(GP_OS_darwin)
@@ -61,6 +62,7 @@ static inline pid_t gettid() { return (pid_t)syscall(SYS_thread_selfid); }
#define getpid _getpid
#endif
#endif
+#endif
extern mozilla::LazyLogModule gProfilerLog;
|