[Openmp-commits] [openmp] 30ec488 - [OpenMP] Use pthread_self for __kmp_gettid on Solaris (#138510)

via Openmp-commits openmp-commits at lists.llvm.org
Tue May 6 00:12:20 PDT 2025


Author: Rainer Orth
Date: 2025-05-06T09:12:17+02:00
New Revision: 30ec488716263200f7e6004c4670c77f6ec9fab9

URL: https://github.com/llvm/llvm-project/commit/30ec488716263200f7e6004c4670c77f6ec9fab9
DIFF: https://github.com/llvm/llvm-project/commit/30ec488716263200f7e6004c4670c77f6ec9fab9.diff

LOG: [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`.

Added: 
    

Modified: 
    openmp/runtime/src/kmp_wrapper_getpid.h

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_wrapper_getpid.h b/openmp/runtime/src/kmp_wrapper_getpid.h
index c6c7ac01799a0..9854d61aa5522 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 <pthread.h>
 #define __kmp_gettid() pthread_self()
 #elif KMP_OS_HAIKU


        


More information about the Openmp-commits mailing list