[llvm-branch-commits] [openmp] 2b82ec7 - [OpenMP] Use the more appropriate function to retrieve the thread id on OpenBSD (#65553)

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 30 02:20:50 PDT 2023


Author: Brad Smith
Date: 2023-10-30T10:18:17+01:00
New Revision: 2b82ec7947fe070c16091a7724b2865d49e3c299

URL: https://github.com/llvm/llvm-project/commit/2b82ec7947fe070c16091a7724b2865d49e3c299
DIFF: https://github.com/llvm/llvm-project/commit/2b82ec7947fe070c16091a7724b2865d49e3c299.diff

LOG: [OpenMP] Use the more appropriate function to retrieve the thread id on OpenBSD (#65553)

Use the getthrid() function instead of a syscall.

(cherry picked from commit 7e31b45d6a2571ff17426930dcbb784473a965b4)

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 32ede3ed715b4ac..82b1fe767507d3a 100644
--- a/openmp/runtime/src/kmp_wrapper_getpid.h
+++ b/openmp/runtime/src/kmp_wrapper_getpid.h
@@ -30,7 +30,7 @@
 #include <lwp.h>
 #define __kmp_gettid() _lwp_self()
 #elif KMP_OS_OPENBSD
-#define __kmp_gettid() syscall(SYS_getthrid)
+#define __kmp_gettid() getthrid()
 #elif defined(SYS_gettid)
 // Hopefully other Unix systems define SYS_gettid syscall for getting os thread
 // id


        


More information about the llvm-branch-commits mailing list