summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2018-12-11 18:34:33 +0000
committerKamil Rytarowski <n54@gmx.com>2018-12-11 18:34:33 +0000
commit3bd320e8c97d629bd6f79f2bd4dfd13da0047b8e (patch)
tree86b3d16da6da557bd0c600f411d5df1c540e63b1 /openmp
parent9477fdb5c83bbdf1d93e3e201d565f1828a83e7f (diff)
Implement __kmp_gettid() for NetBSD
Summary: _lwp_self() returns current Thread Id in a numeric version on NetBSD. Reviewers: joerg, mgorny, #openmp Reviewed By: mgorny Subscribers: llvm-commits, openmp-commits, #openmp Tags: #openmp Differential Revision: https://reviews.llvm.org/D55497
Diffstat (limited to 'openmp')
-rw-r--r--openmp/runtime/src/kmp_wrapper_getpid.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/openmp/runtime/src/kmp_wrapper_getpid.h b/openmp/runtime/src/kmp_wrapper_getpid.h
index a9ddbe87d86..47e27282a74 100644
--- a/openmp/runtime/src/kmp_wrapper_getpid.h
+++ b/openmp/runtime/src/kmp_wrapper_getpid.h
@@ -24,6 +24,9 @@
#if KMP_OS_DARWIN
// OS X
#define __kmp_gettid() syscall(SYS_thread_selfid)
+#elif KMP_OS_NETBSD
+#include <lwp.h>
+#define __kmp_gettid() _lwp_self()
#elif defined(SYS_gettid)
// Hopefully other Unix systems define SYS_gettid syscall for getting os thread
// id