$OpenBSD: patch-src_shared_qbs_src_lib_corelib_tools_processutils_cpp,v 1.3 2017/06/14 17:11:20 rsadowski Exp $
Index: src/shared/qbs/src/lib/corelib/tools/processutils.cpp
--- src/shared/qbs/src/lib/corelib/tools/processutils.cpp.orig
+++ src/shared/qbs/src/lib/corelib/tools/processutils.cpp
@@ -49,6 +49,11 @@
 #   include "fileinfo.h"
 #   include <unistd.h>
 #   include <cstdio>
+#elif defined(Q_OS_OPENBSD)
+#   include <sys/param.h>
+#   include <sys/sysctl.h>
+#   include <fcntl.h>
+#   include <kvm.h>
 #elif defined(Q_OS_BSD4)
 # include <QtCore/qfile.h>
 #   include <sys/cdefs.h>
@@ -94,6 +99,19 @@ QString processNameByPid(qint64 pid)
     sprintf(exePath, "/proc/%lld/exe", pid);
     readlink(exePath, buf, sizeof(buf));
     return FileInfo::fileName(QString::fromUtf8(buf));
+#elif defined(Q_OS_OPENBSD)
+    kvm_t *kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, NULL);
+    if (!kd)
+        return QString();
+    int cnt;
+    struct kinfo_proc *kp = kvm_getprocs(kd, KERN_PROC_PID, pid, sizeof(*kp), &cnt);
+    if (!kp || cnt < 1) {
+        kvm_close(kd);
+        return QString();
+    }
+    QString name = QString::fromUtf8(kp->p_comm);
+    kvm_close(kd);
+    return name;
 #elif defined(Q_OS_BSD4)
 # if defined(Q_OS_NETBSD)
     struct kinfo_proc2 kp;
