Author: vkalintiris Date: Tue Sep 22 09:52:31 2015 New Revision: 248280 URL: http://llvm.org/viewvc/llvm-project?rev=248280&view=rev Log: 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 Modified: lldb/trunk/source/Host/linux/HostThreadLinux.cpp Modified: lldb/trunk/source/Host/linux/HostThreadLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/HostThreadLinux.cpp?rev=248280&r1=248279&r2=248280&view=diff ============================================================================== --- lldb/trunk/source/Host/linux/HostThreadLinux.cpp (original) +++ lldb/trunk/source/Host/linux/HostThreadLinux.cpp Tue Sep 22 09:52:31 2015 @@ -30,7 +30,12 @@ HostThreadLinux::HostThreadLinux(lldb::t 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 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits