Skip to content

Commit

Permalink
Do not use pthread_setname_np() if we don't have GLIBC or Android.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Vasileios Kalintiris authored and Vasileios Kalintiris committed Sep 22, 2015
1 parent 766f9c3 commit 747372b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lldb/source/Host/linux/HostThreadLinux.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 747372b

Please sign in to comment.