$OpenBSD: patch-third_party_webrtc_rtc_base_platform_thread_types_cc,v 1.2 2019/09/23 07:18:04 robert Exp $

Index: third_party/webrtc/rtc_base/platform_thread_types.cc
--- third_party/webrtc/rtc_base/platform_thread_types.cc.orig
+++ third_party/webrtc/rtc_base/platform_thread_types.cc
@@ -11,7 +11,9 @@
 #include "rtc_base/platform_thread_types.h"
 
 #if defined(WEBRTC_LINUX)
+#if !defined(__OpenBSD__)
 #include <sys/prctl.h>
+#endif
 #include <sys/syscall.h>
 #endif
 
@@ -27,8 +29,10 @@ PlatformThreadId CurrentThreadId() {
   return gettid();
 #elif defined(WEBRTC_FUCHSIA)
   return zx_thread_self();
-#elif defined(WEBRTC_LINUX)
+#elif defined(WEBRTC_LINUX) && !defined(__OpenBSD__)
   return syscall(__NR_gettid);
+#elif defined(__OpenBSD__)
+  return reinterpret_cast<uint64_t>(pthread_self());
 #elif defined(__EMSCRIPTEN__)
   return static_cast<PlatformThreadId>(pthread_self());
 #else
@@ -57,6 +61,7 @@ bool IsThreadRefEqual(const PlatformThreadRef& a, cons
 }
 
 void SetCurrentThreadName(const char* name) {
+#if !defined(__OpenBSD__)
 #if defined(WEBRTC_WIN)
   struct {
     DWORD dwType;
@@ -74,6 +79,7 @@ void SetCurrentThreadName(const char* name) {
   prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name));  // NOLINT
 #elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
   pthread_setname_np(name);
+#endif
 #endif
 }
 
