[Lldb-commits] [PATCH] D30844: pthread_setname_np first appeared in glibc 2.12

Jonathan Roelofs via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 10 13:23:06 PST 2017


jroelofs created this revision.
Herald added a subscriber: srhines.

Alternatively, I could teach llvm:set_thread_name() how to take a thread parameter, and use that here instead.


https://reviews.llvm.org/D30844

Files:
  source/Host/linux/HostThreadLinux.cpp


Index: source/Host/linux/HostThreadLinux.cpp
===================================================================
--- source/Host/linux/HostThreadLinux.cpp
+++ source/Host/linux/HostThreadLinux.cpp
@@ -23,7 +23,8 @@
     : HostThreadPosix(thread) {}
 
 void HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name) {
-#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
+#if (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)) && \
+     defined(_GNU_SOURCE)) || defined(__ANDROID__)
   ::pthread_setname_np(thread, name.data());
 #else
   (void)thread;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30844.91401.patch
Type: text/x-patch
Size: 599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170310/20e75acc/attachment.bin>


More information about the lldb-commits mailing list