krytarowski created this revision.
krytarowski added a project: LLDB.

To retrieve the native thread ID there must be called _lwp_self().

Sponsored by <The NetBSD Foundation>


Repository:
  rL LLVM

https://reviews.llvm.org/D29264

Files:
  source/Host/common/Host.cpp


Index: source/Host/common/Host.cpp
===================================================================
--- source/Host/common/Host.cpp
+++ source/Host/common/Host.cpp
@@ -40,6 +40,10 @@
 #include <pthread_np.h>
 #endif
 
+#if defined(__NetBSD__)
+#include <lwp.h>
+#endif
+
 // C++ Includes
 
 // Other libraries and framework includes
@@ -320,6 +324,8 @@
   return thread_self;
 #elif defined(__FreeBSD__)
   return lldb::tid_t(pthread_getthreadid_np());
+#elif defined(__NetBSD__)
+  return lldb::tid_t(_lwp_self());
 #elif defined(__ANDROID__)
   return lldb::tid_t(gettid());
 #elif defined(__linux__)


Index: source/Host/common/Host.cpp
===================================================================
--- source/Host/common/Host.cpp
+++ source/Host/common/Host.cpp
@@ -40,6 +40,10 @@
 #include <pthread_np.h>
 #endif
 
+#if defined(__NetBSD__)
+#include <lwp.h>
+#endif
+
 // C++ Includes
 
 // Other libraries and framework includes
@@ -320,6 +324,8 @@
   return thread_self;
 #elif defined(__FreeBSD__)
   return lldb::tid_t(pthread_getthreadid_np());
+#elif defined(__NetBSD__)
+  return lldb::tid_t(_lwp_self());
 #elif defined(__ANDROID__)
   return lldb::tid_t(gettid());
 #elif defined(__linux__)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to