aboutsummaryrefslogtreecommitdiffstats
path: root/alc/helpers.cpp
diff options
context:
space:
mode:
authorDavid Carlier <[email protected]>2020-07-21 17:22:38 +0000
committerDavid Carlier <[email protected]>2020-07-21 17:22:38 +0000
commitd3ffaeb8d7ce2867fa199bee7d8e2c566b839351 (patch)
treeeaa378ccb0081b0f0cc002b76b23e8a33ce4fd90 /alc/helpers.cpp
parentf409cb4039260031b3d0c7779a0970034334139d (diff)
GetProcBinary implementation for Haiku.
Diffstat (limited to 'alc/helpers.cpp')
-rw-r--r--alc/helpers.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/alc/helpers.cpp b/alc/helpers.cpp
index 22483dd3..cd1d6498 100644
--- a/alc/helpers.cpp
+++ b/alc/helpers.cpp
@@ -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
@@ -256,6 +259,13 @@ const PathNamePair &GetProcBinary()
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())
{
static const char SelfLinkNames[][32]{