[Openmp-commits] [PATCH] D55497: Implement __kmp_gettid() for NetBSD

Kamil Rytarowski via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Dec 9 09:23:17 PST 2018


krytarowski created this revision.
krytarowski added reviewers: joerg, mgorny, OpenMP.
krytarowski added a project: OpenMP.
Herald added a subscriber: llvm-commits.
krytarowski edited the summary of this revision.

_lwp_self() returns current Thread Id in a numeric version on NetBSD.


Repository:
  rL LLVM

https://reviews.llvm.org/D55497

Files:
  runtime/src/kmp_wrapper_getpid.h


Index: runtime/src/kmp_wrapper_getpid.h
===================================================================
--- runtime/src/kmp_wrapper_getpid.h
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55497.177441.patch
Type: text/x-patch
Size: 469 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20181209/5f786c3a/attachment.bin>


More information about the Openmp-commits mailing list