1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Add OpenBSD support to be able to get the thread name

llvm-svn: 353367
This commit is contained in:
Brad Smith 2019-02-07 02:06:58 +00:00
parent fc998c1211
commit ab1b75a2c1

View File

@ -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