aboutsummaryrefslogtreecommitdiff
path: root/zencore/thread.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2023-01-30 09:48:30 +0100
committerMartin Ridgers <[email protected]>2023-02-02 14:55:14 +0100
commit0bb53f311cb9692ed84bb5fcecd34631ba1997a4 (patch)
tree15df7f651fa2edc78700d5ec1bd0988adb34200e /zencore/thread.cpp
parentFix Clang warning about bitwise ops on boolean values (diff)
downloadzen-0bb53f311cb9692ed84bb5fcecd34631ba1997a4.tar.xz
zen-0bb53f311cb9692ed84bb5fcecd34631ba1997a4.zip
Call gettid syscall directly as gettid() is not available in earlier glibc
Diffstat (limited to 'zencore/thread.cpp')
-rw-r--r--zencore/thread.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp
index 77b75bae3..1597a7dd9 100644
--- a/zencore/thread.cpp
+++ b/zencore/thread.cpp
@@ -29,6 +29,7 @@
# include <sys/file.h>
# include <sys/sem.h>
# include <sys/stat.h>
+# include <sys/syscall.h>
# include <sys/wait.h>
# include <time.h>
# include <unistd.h>
@@ -1065,7 +1066,7 @@ GetCurrentThreadId()
#if ZEN_PLATFORM_WINDOWS
return ::GetCurrentThreadId();
#elif ZEN_PLATFORM_LINUX
- return int(gettid());
+ return int(syscall(SYS_gettid));
#elif ZEN_PLATFORM_MAC
return int(pthread_mach_thread_np(pthread_self()));
#endif