summaryrefslogtreecommitdiffstats
path: root/compat/Thread.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:25:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:25:49 +0000
commit15c210fff53f4ce7057339a77f93ca955ee5cd46 (patch)
tree856918348b7a9cf74565389191206fb18f11c6d8 /compat/Thread.c
parentAdding debian version 2.1.9+dfsg-1. (diff)
downloadiperf-15c210fff53f4ce7057339a77f93ca955ee5cd46.tar.xz
iperf-15c210fff53f4ce7057339a77f93ca955ee5cd46.zip
Merging upstream version 2.2.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--compat/Thread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/compat/Thread.c b/compat/Thread.c
index 307535e..4189a64 100644
--- a/compat/Thread.c
+++ b/compat/Thread.c
@@ -136,7 +136,13 @@ static int __log(const char *level, const char *format, va_list args) {
char logformat[]="%s(%ld):[%s] %s\n";
__gettimestamp(timestamp);
- #if HAVE_GETTID_SYSCALL
+
+ #if HAVE_DECL_PTHREAD_THREADID_NP
+ uint64_t tid;
+ if (pthread_threadid_np(NULL, &tid) != 0) {
+ tid = -1;
+ }
+ #elif HAVE_GETTID_SYSCALL
unsigned long tid = syscall(SYS_gettid);
#else
unsigned long tid = -1;