diff options
author | Brad Smith <brad@comstyle.com> | 2023-02-20 04:50:03 -0500 |
---|---|---|
committer | Tormod Volden <debian.tormod@gmail.com> | 2023-03-12 14:52:23 +0100 |
commit | 4dbcefaf61a36ad95af74fdb93979230efdaa68f (patch) | |
tree | f0590c43b6a3a909aab360506c0b36c9f2a83f6e | |
parent | 223cf90b27509351ab2f4d4738c7d2d6c2980454 (diff) | |
download | libusb-4dbcefaf61a36ad95af74fdb93979230efdaa68f.tar.gz |
threads_posix: Use proper getthrid() for thread ID on OpenBSD
OpenBSD no longer allows syscalls like this:
https://lwn.net/Articles/806776/
Closes #1247
-rw-r--r-- | libusb/os/threads_posix.c | 6 | ||||
-rw-r--r-- | 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 <lwp.h> #elif defined(__OpenBSD__) -# define _BSD_SOURCE -# include <sys/syscall.h> # include <unistd.h> #elif defined(__sun__) # include <sys/lwp.h> @@ -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 |