aboutsummaryrefslogtreecommitdiff
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
commit98bdf1f21d0a22b0d77ffa7ec86c66d337ef2d6a (patch)
treedb514223cf847b87076ae38a1c6fedf130475089 /openmp
parent97569391eadefedeb66ef6ce9ce6e185d53e506b (diff)
downloadllvm-98bdf1f21d0a22b0d77ffa7ec86c66d337ef2d6a.zip
llvm-98bdf1f21d0a22b0d77ffa7ec86c66d337ef2d6a.tar.gz
llvm-98bdf1f21d0a22b0d77ffa7ec86c66d337ef2d6a.tar.bz2
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 llvm-svn: 348873
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 a9ddbe8..47e2728 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