]> git.kaiwu.me - quickjs.git/commitdiff
Define a fallback PATH_MAX if not available
authorPino Toscano <toscano.pino@tiscali.it>
Sun, 9 Jun 2024 07:23:49 +0000 (09:23 +0200)
committerCharlie Gordon <github@chqrlie.org>
Sun, 21 Jul 2024 08:24:01 +0000 (10:24 +0200)
PATH_MAX is optional in POSIX, and it is not available on GNU/Hurd.
While it could be possible to not rely on PATH_MAX, for now provide a
fallback definition (which should be safe enough) to get quickjs built
on GNU/Hurd.

quickjs-libc.c

index 40482a50c002d8980cb8501cc11a84d5411baa5d..141f79f3c7ab2032a0d3ef81132b47d8ffd2531a 100644 (file)
@@ -78,6 +78,10 @@ typedef sig_t sighandler_t;
 #include "list.h"
 #include "quickjs-libc.h"
 
+#if !defined(PATH_MAX)
+#define PATH_MAX 4096
+#endif
+
 /* TODO:
    - add socket calls
 */