From 43bdb6fd510c68b2972adffde381003e1cefb3bb Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Tue, 3 Nov 2015 14:31:04 +0300
Subject: Haiku: implement processNameByPid


diff --git a/src/lib/corelib/tools/processutils.cpp b/src/lib/corelib/tools/processutils.cpp
index 2f8254a..edafaa4 100644
--- a/src/lib/corelib/tools/processutils.cpp
+++ b/src/lib/corelib/tools/processutils.cpp
@@ -49,6 +49,8 @@
 #   include "fileinfo.h"
 #   include <unistd.h>
 #   include <cstdio>
+#elif defined(Q_OS_HAIKU)
+#   include <OS.h>
 #elif defined(Q_OS_BSD4)
 # include <QFile>
 #   include <sys/cdefs.h>
@@ -94,6 +96,13 @@ 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_HAIKU)
+	team_info info;
+	if(get_team_info((team_id)pid, &info)==B_OK) {
+		if(info.argc >= 1)
+			return QString::fromUtf8(info.args);
+	}
+	return QString();
 #elif defined(Q_OS_BSD4)
 # if defined(Q_OS_NETBSD)
     struct kinfo_proc2 kp;
-- 
2.10.2

