GetProcBinary implementation for Haiku.

This commit is contained in:
David Carlier
2020-07-21 17:22:38 +00:00
parent f409cb4039
commit d3ffaeb8d7
+10
View File
@@ -218,6 +218,9 @@ void SetRTPriority(void)
#ifdef __FreeBSD__
#include <sys/sysctl.h>
#endif
#ifdef __HAIKU__
#include <FindDirectory.h>
#endif
#ifdef HAVE_PROC_PIDPATH
#include <libproc.h>
#endif
@@ -255,6 +258,13 @@ const PathNamePair &GetProcBinary()
else
pathname.insert(pathname.end(), procpath, procpath+strlen(procpath));
}
#endif
#ifdef __HAIKU__
char procpath[PATH_MAX];
if(find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, procpath, sizeof(procpath)) == B_OK)
{
pathname.insert(pathname.end(), procpath, procpath+strlen(procpath));
}
#endif
if(pathname.empty())
{