diff options
author | Wolfgang Schupp <w.schupp@a1.net> | 2022-04-03 06:46:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-03 06:46:02 +0200 |
commit | 00c1eb85754465719d675936dfc71e71a53acc96 (patch) | |
tree | 86308cf4a26d99f11a300fabe96a4736523ee2de | |
parent | 89eeb1432acba1d8e417a29632c8d75fd5ecfaed (diff) | |
parent | b5b2be7121f750b5f27d205e2b11ce0179b388cf (diff) |
Merge pull request #21209 from wsnipex/fix_build_old_glibc
[linux/threads] define gettid for glibc < 2.30 (fixes #21208)
-rw-r--r-- | xbmc/platform/linux/threads/ThreadImplLinux.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/xbmc/platform/linux/threads/ThreadImplLinux.cpp b/xbmc/platform/linux/threads/ThreadImplLinux.cpp index 1617e50941..f8c9c70292 100644 --- a/xbmc/platform/linux/threads/ThreadImplLinux.cpp +++ b/xbmc/platform/linux/threads/ThreadImplLinux.cpp @@ -17,6 +17,12 @@ #include <sys/resource.h> #include <unistd.h> +#if !defined(TARGET_ANDROID) && (defined(__GLIBC__) || defined(__UCLIBC__)) +#if defined(__UCLIBC__) || !__GLIBC_PREREQ(2, 30) +#include <sys/syscall.h> +#endif +#endif + namespace { @@ -42,6 +48,15 @@ int ThreadPriorityToNativePriority(const ThreadPriority& priority) throw std::runtime_error("priority not implemented"); } +#if !defined(TARGET_ANDROID) && (defined(__GLIBC__) || defined(__UCLIBC__)) +#if defined(__UCLIBC__) || !__GLIBC_PREREQ(2, 30) +static pid_t gettid() +{ + return syscall(__NR_gettid); +} +#endif +#endif + } // namespace static int s_maxPriority; |