From f12ef07c02ab2528dff399c924100866ab4b1b97 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 13 Aug 2025 17:02:22 +0500 Subject: [PATCH] engine: whereami: add support for GNU/Hurd --- engine/common/whereami.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/common/whereami.c b/engine/common/whereami.c index 31726774..3eb3f086 100644 --- a/engine/common/whereami.c +++ b/engine/common/whereami.c @@ -175,7 +175,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) return length; } -#elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(__serenity__) || defined(WAI_USE_PROC_SELF_EXE) +#elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(__serenity__) || defined(__gnu_hurd__) || defined(WAI_USE_PROC_SELF_EXE) #include #include @@ -191,6 +191,10 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) #include #include +#if defined(__gnu_hurd__) && !defined(PATH_MAX) +#define PATH_MAX 4096 +#endif // defined(__gnu_hurd__) && !defined(PATH_MAX) + #if !defined(WAI_PROC_SELF_EXE) #if defined(__sun) #define WAI_PROC_SELF_EXE "/proc/self/path/a.out"