From 30ec488716263200f7e6004c4670c77f6ec9fab9 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Tue, 6 May 2025 09:12:17 +0200 Subject: [PATCH] [OpenMP] Use pthread_self for __kmp_gettid on Solaris (#138510) Building `openmp` on Solaris/amd64, I get ``` In file included from openmp/runtime/src/kmp_utility.cpp:16: openmp/runtime/src/kmp_wrapper_getpid.h:47:2: warning: No gettid found, use getpid instead [-W#warnings] 47 | #warning No gettid found, use getpid instead | ^ ``` There's no reason to do this: Solaris can use `pthread_self` just as AIX does. Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`. --- openmp/runtime/src/kmp_wrapper_getpid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmp/runtime/src/kmp_wrapper_getpid.h b/openmp/runtime/src/kmp_wrapper_getpid.h index c6c7ac01799a..9854d61aa552 100644 --- a/openmp/runtime/src/kmp_wrapper_getpid.h +++ b/openmp/runtime/src/kmp_wrapper_getpid.h @@ -33,7 +33,7 @@ #define __kmp_gettid() _lwp_self() #elif KMP_OS_OPENBSD #define __kmp_gettid() getthrid() -#elif KMP_OS_AIX +#elif KMP_OS_AIX || KMP_OS_SOLARIS #include #define __kmp_gettid() pthread_self() #elif KMP_OS_HAIKU