Add OpenBSD support to be able to get the thread name
llvm-svn: 353367
This commit is contained in:
parent
2b93ef7ef6
commit
01227fea9e
|
@ -201,6 +201,12 @@ void llvm::get_thread_name(SmallVectorImpl<char> &Name) {
|
|||
char buf[len];
|
||||
::pthread_getname_np(::pthread_self(), buf, len);
|
||||
|
||||
Name.append(buf, buf + strlen(buf));
|
||||
#elif defined(__OpenBSD__)
|
||||
constexpr uint32_t len = get_max_thread_name_length_impl();
|
||||
char buf[len];
|
||||
::pthread_get_name_np(::pthread_self(), buf, len);
|
||||
|
||||
Name.append(buf, buf + strlen(buf));
|
||||
#elif defined(__linux__)
|
||||
#if HAVE_PTHREAD_GETNAME_NP
|
||||
|
|
Loading…
Reference in New Issue