diff --git a/config/system-headers b/config/system-headers index 438b6f28b58..5bebed9f2bf 100644 --- a/config/system-headers +++ b/config/system-headers @@ -594,6 +594,7 @@ proto/exec.h psap.h Pt.h pthread.h +pthread_np.h pwd.h Python.h QDOffscreen.h diff --git a/ipc/chromium/src/base/platform_thread_posix.cc b/ipc/chromium/src/base/platform_thread_posix.cc index 8ee42ce6c33..1b2ecf75384 100644 --- a/ipc/chromium/src/base/platform_thread_posix.cc +++ b/ipc/chromium/src/base/platform_thread_posix.cc @@ -11,7 +11,11 @@ #include #elif defined(OS_LINUX) #include +#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) #include +#elif !defined(__NetBSD__) +#include +#endif #include #endif @@ -34,7 +38,7 @@ PlatformThreadId PlatformThread::CurrentId() { // into the kernel. #if defined(OS_MACOSX) return mach_thread_self(); -#elif defined (__OpenBSD__) +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) // TODO(BSD): find a better thread ID return (intptr_t)(pthread_self()); #elif defined(OS_LINUX) @@ -79,7 +83,13 @@ void PlatformThread::SetName(const char* name) { // Note that glibc also has a 'pthread_setname_np' api, but it may not be // available everywhere and it's only benefit over using prctl directly is // that it can set the name of threads other than the current thread. +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) + pthread_set_name_np(pthread_self(), name); +#elif defined(__NetBSD__) + pthread_setname_np(pthread_self(), "%s", name); +#else prctl(PR_SET_NAME, reinterpret_cast(name), 0, 0, 0); +#endif } #endif // !OS_MACOSX diff --git a/js/src/config/system-headers b/js/src/config/system-headers index 438b6f28b58..5bebed9f2bf 100644 --- a/js/src/config/system-headers +++ b/js/src/config/system-headers @@ -594,6 +594,7 @@ proto/exec.h psap.h Pt.h pthread.h +pthread_np.h pwd.h Python.h QDOffscreen.h