From 542611c5e23a1341a29ce4f812a585a920d400c2 Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Sat, 19 Mar 2022 09:36:35 +0200 Subject: [PATCH] Include sys/auxv.h in getexepath --- src/native/minipal/getexepath.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/native/minipal/getexepath.h b/src/native/minipal/getexepath.h index ecc6dc8d72771b..0db1b73aa6f011 100644 --- a/src/native/minipal/getexepath.h +++ b/src/native/minipal/getexepath.h @@ -17,6 +17,8 @@ #include #elif defined(_WIN32) #include +#elif HAVE_GETAUXVAL +#include #endif #ifdef __cplusplus @@ -74,8 +76,8 @@ static inline char* minipal_getexepath(void) return strdup("/managed"); #else #if HAVE_GETAUXVAL && defined(AT_EXECFN) - const char* path = (const char *)getauxval(AT_EXECFN); - if (path) + const char* path = (const char *)(getauxval(AT_EXECFN)); + if (path && !errno) { return realpath(path, NULL); }