Implement __kmp_gettid() for NetBSD
authorKamil Rytarowski <n54@gmx.com>
Tue, 11 Dec 2018 18:34:33 +0000 (18:34 +0000)
committerKamil Rytarowski <n54@gmx.com>
Tue, 11 Dec 2018 18:34:33 +0000 (18:34 +0000)
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

openmp/runtime/src/kmp_wrapper_getpid.h

index a9ddbe8..47e2728 100644 (file)
@@ -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