From 4dbcefaf61a36ad95af74fdb93979230efdaa68f Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 20 Feb 2023 04:50:03 -0500 Subject: threads_posix: Use proper getthrid() for thread ID on OpenBSD OpenBSD no longer allows syscalls like this: https://lwn.net/Articles/806776/ Closes #1247 --- libusb/os/threads_posix.c | 6 +----- libusb/version_nano.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/libusb/os/threads_posix.c b/libusb/os/threads_posix.c index 0e0e221..0079fd5 100644 --- a/libusb/os/threads_posix.c +++ b/libusb/os/threads_posix.c @@ -32,8 +32,6 @@ #elif defined(__NetBSD__) # include #elif defined(__OpenBSD__) -# define _BSD_SOURCE -# include # include #elif defined(__sun__) # include @@ -109,9 +107,7 @@ unsigned int usbi_get_tid(void) #elif defined(__NetBSD__) tid = _lwp_self(); #elif defined(__OpenBSD__) - /* The following only works with OpenBSD > 5.1 as it requires - * real thread support. For 5.1 and earlier, -1 is returned. */ - tid = syscall(SYS_getthrid); + tid = getthrid(); #elif defined(__sun__) tid = _lwp_self(); #else diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 335ff4e..fefe657 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11788 +#define LIBUSB_NANO 11789 -- cgit v1.2.1