diff --git a/Source/Common/Thread.cpp b/Source/Common/Thread.cpp index 904727e7b..a58b4aa87 100644 --- a/Source/Common/Thread.cpp +++ b/Source/Common/Thread.cpp @@ -3,6 +3,7 @@ #ifndef _WIN32 #include #include +#include #endif CThread::CThread(CTHREAD_START_ROUTINE lpStartAddress) : @@ -125,6 +126,8 @@ uint32_t CThread::GetCurrentThreadId(void) { #ifdef _WIN32 return ::GetCurrentThreadId(); +#elif defined(SYS_gettid) || defined(__NR_gettid) + return syscall(__NR_gettid); /* GLIBC has no implementation of gettid(). */ #else return gettid(); #endif