[Openmp-commits] [openmp] [OpenMP] Use the more appropriate function to retrieve the thread id on OpenBSD (PR #65553)

Brad Smith via Openmp-commits openmp-commits at lists.llvm.org
Wed Sep 6 18:13:52 PDT 2023


https://github.com/brad0 updated https://github.com/llvm/llvm-project/pull/65553:

>From b42c4276ab63fd7b29c459afbd5fa75a04aedc6c Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Wed, 6 Sep 2023 20:00:18 -0400
Subject: [PATCH] [OpenMP] Use the more appropriate function to retrieve the
 thread id on OpenBSD

Use the getthrid() function instead of a syscall.
---
 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 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 Openmp-commits mailing list