Index: src/modules/module-rt.c
--- src/modules/module-rt.c.orig
+++ src/modules/module-rt.c
@@ -256,6 +256,8 @@ static pid_t _gettid(void)
 	long pid;
 	thr_self(&pid);
 	return (pid_t)pid;
+#elif defined(__OpenBSD__)
+       return getthrid();
 #elif defined(__GNU__)
        mach_port_t thread = hurd_thread_self();
        return (pid_t)thread;
