Skip to content

Commit

Permalink
Include sys/auxv.h in getexepath (#66874)
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 authored Mar 19, 2022
1 parent 7a7304e commit 14304eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/native/minipal/getexepath.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <sys/sysctl.h>
#elif defined(_WIN32)
#include <windows.h>
#elif HAVE_GETAUXVAL
#include <sys/auxv.h>
#endif

#ifdef __cplusplus
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 14304eb

Please sign in to comment.