Index: src/base/platform/platform-posix.cc |
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc |
index 8454213def9308ef2d89e9b758f506af764e330c..75283d52ef73f4e0b673dd1a88579b47efe05681 100644 |
--- a/src/base/platform/platform-posix.cc |
+++ b/src/base/platform/platform-posix.cc |
@@ -20,9 +20,9 @@ |
#include <sys/mman.h> |
#include <sys/resource.h> |
#include <sys/stat.h> |
+#include <sys/syscall.h> |
#include <sys/time.h> |
#include <sys/types.h> |
- |
#if defined(__linux__) |
#include <sys/prctl.h> // NOLINT, for prctl |
#endif |
@@ -318,6 +318,11 @@ int OS::GetCurrentProcessId() { |
} |
+int OS::GetCurrentThreadId() { |
+ return static_cast<int>(syscall(SYS_gettid)); |
+} |
+ |
+ |
// ---------------------------------------------------------------------------- |
// POSIX date/time support. |
// |