Fallback to _POSIX_PATH_MAX when MAXPATHLEN isn't available (#130)

On systems where MAXPATHLEN isn't defined, like GNU/Hurd, use
_POSIX_PATH_MAX as the starting size for the getcwd() buffer.
This commit is contained in:
James McCoy
2019-10-29 16:08:55 -04:00
committed by Hisham Muhammad
parent 1dfb8c41e8
commit 04bdaf9a1e

View File

@@ -60,7 +60,12 @@
#include <sys/types.h> #include <sys/types.h>
#include <utime.h> #include <utime.h>
#include <sys/param.h> /* for MAXPATHLEN */ #include <sys/param.h> /* for MAXPATHLEN */
#define LFS_MAXPATHLEN MAXPATHLEN #ifdef MAXPATHLEN
#define LFS_MAXPATHLEN MAXPATHLEN
#else
#include <limits.h> /* for _POSIX_PATH_MAX */
#define LFS_MAXPATHLEN _POSIX_PATH_MAX
#endif
#endif #endif
#include <lua.h> #include <lua.h>