$OpenBSD$

Index: configure
--- configure.orig
+++ configure
@@ -4089,6 +4089,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 		#include "confdefs.h"
+		#if defined(HAVE_SYS_TYPES_H)
+		#include <sys/types.h>
+		#endif
 		#if defined(HAVE_SYS_EVENT_H)
 		#include <sys/event.h>
 		#endif
@@ -4511,6 +4514,33 @@ if ac_fn_cxx_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 		$as_echo "#define HAVE_PTHREAD_SETNAME_NP 3" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_set_name_np(thread, name)" >&5
+$as_echo_n "checking for pthread_set_name_np(thread, name)... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+#include <pthread_np.h>
+int
+main ()
+{
+
+  pthread_set_name_np(pthread_self(), "");
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  $as_echo "#define HAVE_PTHREAD_SET_NAME_NP 1" >>confdefs.h
 
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
