[OpenMP] Use the more appropriate function to retrieve the thread id on OpenBSD ...
authorBrad Smith <brad@comstyle.com>
Fri, 8 Sep 2023 01:05:25 +0000 (21:05 -0400)
committerTobias Hieta <tobias@hieta.se>
Mon, 30 Oct 2023 09:18:17 +0000 (10:18 +0100)
Use the getthrid() function instead of a syscall.

(cherry picked from commit 7e31b45d6a2571ff17426930dcbb784473a965b4)

openmp/runtime/src/kmp_wrapper_getpid.h

index 32ede3e..82b1fe7 100644 (file)
@@ -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