HEX
Server: Apache/2.4.41 (FreeBSD) OpenSSL/1.0.2s mod_fcgid/2.3.9
System: FreeBSD salazo 12.0-RELEASE-p1303-ZFS hostBSD 12.0-RELEASE-p1303-ZFS DMR amd64
User: admin (1000)
PHP: 7.4.3
Disabled: NONE
Upload Files
File: /usr/ports/databases/mongodb49/files/patch-src_mongo_platform_process__id.cpp
--- src/mongo/platform/process_id.cpp.orig	2021-03-26 23:29:14 UTC
+++ src/mongo/platform/process_id.cpp
@@ -35,6 +35,10 @@
 #include <pthread.h>
 #endif
 
+#if defined(__FreeBSD__)
+#include <pthread_np.h>
+#endif
+
 #if defined(__linux__)
 #include <sys/syscall.h>
 #include <sys/types.h>
@@ -72,6 +76,10 @@ inline NativeProcessId getCurrentNativeThreadId() {
     uint64_t tid;
     invariant(::pthread_threadid_np(NULL, &tid) == 0);
     return tid;
+}
+#elif __FreeBSD__
+inline NativeProcessId getCurrentNativeThreadId() {
+    return pthread_getthreadid_np();
 }
 #else
 inline NativeProcessId getCurrentNativeThreadId() {