summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-12-11 13:29:54 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1998-12-11 13:29:54 +0000
commitb990c8b2262dc25c0ee784f342e25f6a67c5ac7e (patch)
tree74c2d8aa8269e8cf3fb8b61cbca6918f3e0c2932 /perl.h
parentc8c809adbd743c4b7fd61ded5e6ea6d88e0aafaa (diff)
downloadperl-b990c8b2262dc25c0ee784f342e25f6a67c5ac7e.tar.gz
MAXPATHLEN.
p4raw-id: //depot/cfgperl@2463
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/perl.h b/perl.h
index 9560567c7d..1546bcdb7e 100644
--- a/perl.h
+++ b/perl.h
@@ -1349,12 +1349,25 @@ typedef I32 (*filter_t) _((int, SV *, int));
# endif
#endif
-/* XXX MAXPATHLEN should be determined by Configure */
#ifndef MAXPATHLEN
# ifdef PATH_MAX
-# define MAXPATHLEN PATH_MAX
+# ifdef _POSIX_PATH_MAX
+# if PATH_MAX > _POSIX_PATH_MAX
+/* MAXPATHLEN is supposed to include the final null character,
+ * as opposed to PATH_MAX and _POSIX_PATH_MAX. */
+# define MAXPATHLEN (PATH_MAX+1)
+# else
+# define MAXPATHLEN (_POSIX_PATH_MAX+1)
+# endif
+# else
+# define MAXPATHLEN (PATH_MAX+1)
+# endif
# else
-# define MAXPATHLEN 1024
+# ifdef _POSIX_PATH_MAX
+# define MAXPATHLEN (_POSIX_PATH_MAX+1)
+# else
+# define MAXPATHLEN 1024 /* Err on the large side. */
+# endif
# endif
#endif