summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorDavid Carlier <dcarlier@afilias.info>2019-06-03 15:43:33 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-06-03 15:43:33 (GMT)
commit0b9956e9162d8723c2a30ff316ecc25e54459fb1 (patch)
treeb266191d989dfeefe00bd5b8b3913bfd398143f5 /Python
parent141da44bb45bc182886303fce92cbbae5631cb4c (diff)
downloadcpython-0b9956e9162d8723c2a30ff316ecc25e54459fb1.zip
cpython-0b9956e9162d8723c2a30ff316ecc25e54459fb1.tar.gz
cpython-0b9956e9162d8723c2a30ff316ecc25e54459fb1.tar.bz2
bpo-37087: Adding native ID support for OpenBSD (GH-13654)
Diffstat (limited to 'Python')
-rw-r--r--Python/thread_pthread.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index f57a1e7..740b521 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -16,6 +16,8 @@
# include <sys/syscall.h> /* syscall(SYS_gettid) */
#elif defined(__FreeBSD__)
# include <pthread_np.h> /* pthread_getthreadid_np() */
+#elif defined(__OpenBSD__)
+# include <unistd.h> /* getthrid() */
#endif
/* The POSIX spec requires that use of pthread_attr_setstacksize
@@ -323,6 +325,9 @@ PyThread_get_thread_native_id(void)
#elif defined(__FreeBSD__)
int native_id;
native_id = pthread_getthreadid_np();
+#elif defined(__OpenBSD__)
+ pid_t native_id;
+ native_id = getthrid();
#endif
return (unsigned long) native_id;
}