Index: sal/osl/unx/thread.cxx
--- sal/osl/unx/thread.cxx.orig
+++ sal/osl/unx/thread.cxx
@@ -31,6 +31,7 @@
 #include <string.h>
 #if defined(OPENBSD)
 #include <sched.h>
+#include <pthread_np.h>
 #endif
 #ifdef __FreeBSD__
 #if __FreeBSD_version <= 1201517
@@ -548,6 +549,8 @@ void SAL_CALL osl_setThreadName(char const * name)
     int err = pthread_setname_np( pthread_self(), shortname );
     if ( 0 != err )
         SAL_WARN("sal.osl", "pthread_setname_np failed with errno " << err);
+#elif defined __OpenBSD__
+    pthread_set_name_np( pthread_self(), name );
 #elif defined __FreeBSD__
     pthread_setname_np( pthread_self(), name );
 #elif defined MACOSX || defined IOS
@@ -575,7 +578,7 @@ const int HashSize = SAL_N_ELEMENTS(HashTable);
 
 static std::mutex HashLock;
 
-#if ! ((defined LINUX && !defined __FreeBSD_kernel__) || defined MACOSX || defined IOS)
+#if ! ((defined LINUX && !defined __FreeBSD_kernel__) || defined MACOSX || defined IOS || defined OPENBSD)
 static oslThreadIdentifier LastIdent = 0;
 #endif
 
@@ -642,6 +645,8 @@ static oslThreadIdentifier insertThreadId (pthread_t h
         }
 #endif
         pEntry->Ident = tid;
+#elif defined OPENBSD
+        pEntry->Ident = reinterpret_cast<uint64_t>(pthread_self());
 #elif defined MACOSX || defined IOS
         // currently the value of pthread_threadid_np is the same then
         // syscall(SYS_thread_selfid), which returns an int as the TID.
