diff --git a/src/native/minipal/getexepath.h b/src/native/minipal/getexepath.h index d2a7484da9da57..c0642812477fee 100644 --- a/src/native/minipal/getexepath.h +++ b/src/native/minipal/getexepath.h @@ -17,6 +17,9 @@ #include #elif defined(_WIN32) #include +#elif defined(__HAIKU__) +#include +#include #elif HAVE_GETAUXVAL #include #endif @@ -61,6 +64,16 @@ static inline char* minipal_getexepath(void) return NULL; } + return realpath(path, NULL); +#elif defined(__HAIKU__) + char path[B_PATH_NAME_LENGTH]; + status_t status = find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, path, B_PATH_NAME_LENGTH); + if (status != B_OK) + { + errno = status; + return NULL; + } + return realpath(path, NULL); #elif defined(_WIN32) char path[MAX_PATH];