On 2012.05.08 11:07, Xiaofan Chen wrote:
Martin's answer:
"This is normal, you must use an OpenBSD -current in order
to have real threads enable, until 5.1 OpenBSD only has
userland threads."

OK. If possible, can you try the attached patch on your platform and let me know whether you get a proper thread ID then? This returns -1 on mine, but if we can get something better for -current, we might as well go for it.

Regards,

/Pete
diff --git a/libusb/os/threads_posix.c b/libusb/os/threads_posix.c
index 8e9b490..960b3c2 100644
--- a/libusb/os/threads_posix.c
+++ b/libusb/os/threads_posix.c
@@ -19,7 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__OpenBSD__)
 # include <unistd.h>
 # include <sys/syscall.h>
 #elif defined(__APPLE__)
@@ -66,6 +66,8 @@ int usbi_get_tid(void)
        int ret = -1;
 #if defined(__linux__)
        ret = syscall(SYS_gettid);
+#elif defined(__OpenBSD__)
+       ret = syscall(SYS_getthrid);
 #elif defined(__APPLE__)
        ret = mach_thread_self();
        mach_port_deallocate(mach_task_self(), ret);
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to