diff src/sysfile.h @ 404:2f8bb876ab1d r21-2-32

Import from CVS: tag r21-2-32
author cvs
date Mon, 13 Aug 2007 11:16:07 +0200
parents 74fd4e045ea6
children de805c49cfc1
line wrap: on
line diff
--- a/src/sysfile.h	Mon Aug 13 11:15:00 2007 +0200
+++ b/src/sysfile.h	Mon Aug 13 11:16:07 2007 +0200
@@ -24,6 +24,7 @@
 #define INCLUDED_sysfile_h_
 
 #include <errno.h>
+#include <limits.h>
 
 #ifndef WINDOWSNT
 #include <sys/errno.h>          /* <errno.h> does not always imply this */
@@ -206,10 +207,21 @@
 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
 #endif
 
+/* Client .c files should simply use `PATH_MAX'. */
+#ifndef PATH_MAX
+# if defined (_POSIX_PATH_MAX)
+#  define PATH_MAX _POSIX_PATH_MAX
+# elif defined (MAXPATHLEN)
+#  define PATH_MAX MAXPATHLEN
+# else
+#  define PATH_MAX 1024
+# endif
+#endif
+
+/* MAXPATHLEN is deprecated, but, as of this writing, still used. */
 #ifndef MAXPATHLEN
-/* in 4.1, param.h fails to define this. */
-#define MAXPATHLEN 1024
-#endif /* not MAXPATHLEN */
+# define MAXPATHLEN 1024
+#endif
 
 #ifndef X_OK
 # define X_OK 01