summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/chdir-long.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/chdir-long.h b/lib/chdir-long.h
index 4d1b0019a..47fa79160 100644
--- a/lib/chdir-long.h
+++ b/lib/chdir-long.h
@@ -17,4 +17,19 @@
/* Written by Jim Meyering. */
+#include <unistd.h>
+#include <limits.h>
+
+#ifndef PATH_MAX
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# endif
+#endif
+
+/* On systems without PATH_MAX, presume that chdir accepts
+ arbitrarily long directory names. */
+#ifndef PATH_MAX
+# define chdir_long(Dir) chdir (Dir)
+#else
int chdir_long (char const *dir);
+#endif