summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/linux/HostThreadLinux.cpp
diff options
context:
space:
mode:
authorVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>2015-09-22 14:52:31 +0000
committerVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>2015-09-22 14:52:31 +0000
commit747372b91aacc3504cd6b43dc246a55db1669bec (patch)
tree519f73bde0a0091ad768d3e5ba6f375dde3d752f /lldb/source/Host/linux/HostThreadLinux.cpp
parent766f9c308f271f6d2f871d37a0c1079de58ff6e3 (diff)
downloadbcm5719-llvm-747372b91aacc3504cd6b43dc246a55db1669bec.tar.gz
bcm5719-llvm-747372b91aacc3504cd6b43dc246a55db1669bec.zip
Do not use pthread_setname_np() if we don't have GLIBC or Android.
Summary: pthread_setname_np() is a nonstandard GNU extension and isn't available in every C library. Check before it's usage that GLIBC is available or that we are targeting Android. Reviewers: clayborg, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13019 llvm-svn: 248280
Diffstat (limited to 'lldb/source/Host/linux/HostThreadLinux.cpp')
-rw-r--r--lldb/source/Host/linux/HostThreadLinux.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Host/linux/HostThreadLinux.cpp b/lldb/source/Host/linux/HostThreadLinux.cpp
index 81512154cd5..2312ced0107 100644
--- a/lldb/source/Host/linux/HostThreadLinux.cpp
+++ b/lldb/source/Host/linux/HostThreadLinux.cpp
@@ -30,7 +30,12 @@ HostThreadLinux::HostThreadLinux(lldb::thread_t thread)
void
HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name)
{
+#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
::pthread_setname_np(thread, name.data());
+#else
+ (void) thread;
+ (void) name;
+#endif
}
void
OpenPOWER on IntegriCloud