summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitry Andric <dimitry@andric.com>2019-03-25 18:37:14 +0000
committerDimitry Andric <dimitry@andric.com>2019-03-25 18:37:14 +0000
commitdab9ed87c6c57ce1020822591c5da55ebe064336 (patch)
treef5b62c42316faadbaa65356a8133cf231a9b35bf
parent61708b1e946a6214877f444cae72bc3b25165688 (diff)
downloadbcm5719-llvm-dab9ed87c6c57ce1020822591c5da55ebe064336.tar.gz
bcm5719-llvm-dab9ed87c6c57ce1020822591c5da55ebe064336.zip
Fix gettid warnings on FreeBSD
Summary: [Split off from D59451 to get this fix in separately] While building the 8.0 releases on FreeBSD, I encountered the following warnings in openmp quite a few times: ``` In file included from projects/openmp/runtime/src/kmp_settings.cpp:27: projects/openmp/runtime/src/kmp_wrapper_getpid.h:35:2: warning: #warning is a language extension [-Wpedantic] #warning No gettid found, use getpid instead ^ projects/openmp/runtime/src/kmp_wrapper_getpid.h:35:2: warning: No gettid found, use getpid instead [-W#warnings] 2 warnings generated. ``` I added a gettid wrapper that uses FreeBSD's pthread_getthreadid_np(3) function for this. Reviewers: emaste, jlpeyton, krytarowski, mgorny, protze.joachim Reviewed By: jlpeyton Subscribers: jfb, jdoerfert, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D59735 llvm-svn: 356934
-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 774e1a1d349..70db857bcba 100644
--- a/openmp/runtime/src/kmp_wrapper_getpid.h
+++ b/openmp/runtime/src/kmp_wrapper_getpid.h
@@ -23,6 +23,9 @@
#if KMP_OS_DARWIN
// OS X
#define __kmp_gettid() syscall(SYS_thread_selfid)
+#elif KMP_OS_FREEBSD
+#include <pthread_np.h>
+#define __kmp_gettid() pthread_getthreadid_np()
#elif KMP_OS_NETBSD
#include <lwp.h>
#define __kmp_gettid() _lwp_self()
OpenPOWER on IntegriCloud