From 83bac4113cdd29a204c62b90233d88dc12b02a9e Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Thu, 16 Aug 2012 19:14:30 +0000 Subject: [PATCH] ntdll: Fetch thread id on NetBSD. --- configure | 1 + configure.ac | 1 + dlls/ntdll/server.c | 5 +++++ include/config.h.in | 3 +++ 4 files changed, 10 insertions(+) diff --git a/configure b/configure index 12c99e8154d..a495f790cb5 100755 --- a/configure +++ b/configure @@ -5857,6 +5857,7 @@ for ac_header in \ linux/serial.h \ linux/types.h \ linux/ucdrom.h \ + lwp.h \ mach-o/nlist.h \ mach-o/loader.h \ mach/mach.h \ diff --git a/configure.ac b/configure.ac index c9e81fe1a35..15ada869a6e 100644 --- a/configure.ac +++ b/configure.ac @@ -452,6 +452,7 @@ AC_CHECK_HEADERS(\ linux/serial.h \ linux/types.h \ linux/ucdrom.h \ + lwp.h \ mach-o/nlist.h \ mach-o/loader.h \ mach/mach.h \ diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index cc49bad31cd..218c6eb249b 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -28,6 +28,9 @@ #endif #include #include +#ifdef HAVE_LWP_H +#include +#endif #ifdef HAVE_PTHREAD_NP_H # include #endif @@ -956,6 +959,8 @@ static int get_unix_tid(void) #elif defined(__APPLE__) ret = mach_thread_self(); mach_port_deallocate(mach_task_self(), ret); +#elif defined(__NetBSD__) + ret = _lwp_self(); #elif defined(__FreeBSD__) long lwpid; thr_self( &lwpid ); diff --git a/include/config.h.in b/include/config.h.in index e9416a43601..a00fc1c54cc 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -440,6 +440,9 @@ /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT +/* Define to 1 if you have the header file. */ +#undef HAVE_LWP_H + /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_CPU_H -- 2.11.4.GIT