summaryrefslogtreecommitdiffstats
path: root/defines.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-06-13 18:57:53 +1000
committerDamien Miller <djm@mindrot.org>2000-06-13 18:57:53 +1000
commita66626b2d59d23a26cacfbcf938852a19d8b781d (patch)
treeeac2e5ee6ac5e10b748872a2ff64e0eee9db258d /defines.h
parent6e5d3475a54b33f73d057a83a0f9e4e6d01a5336 (diff)
- (djm) Fixes from Andrew McGill <andrewm@datrix.co.za>:
- Platform define for SCO 3.x which breaks on /dev/ptmx - Detect and try to fix missing MAXPATHLEN
Diffstat (limited to 'defines.h')
-rw-r--r--defines.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/defines.h b/defines.h
index e60a587b..871adbf4 100644
--- a/defines.h
+++ b/defines.h
@@ -4,33 +4,29 @@
/* Necessary headers */
#include <sys/types.h> /* For [u]intxx_t */
-
#include <sys/socket.h> /* For SHUT_XXXX */
-
-# include <netinet/in_systm.h> /* For typedefs */
+#include <sys/param.h> /* For MAXPATHLEN */
+#include <netinet/in_systm.h> /* For typedefs */
#include <netinet/in.h> /* For IPv6 macros */
#include <netinet/ip.h> /* For IPTOS macros */
-
#ifdef HAVE_SYS_BITYPES_H
# include <sys/bitypes.h> /* For u_intXX_t */
#endif
-
#ifdef HAVE_PATHS_H
# include <paths.h> /* For _PATH_XXX */
#endif
-
+#ifdef HAVE_LIMITS_H
+# include <limits.h> /* For PATH_MAX */
+#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h> /* For timersub */
#endif
-
#ifdef HAVE_MAILLOCK_H
# include <maillock.h> /* For _PATH_MAILDIR */
#endif
-
#ifdef HAVE_SYS_CDEFS_H
# include <sys/cdefs.h> /* For __P() */
#endif
-
#ifdef HAVE_SYS_SYSMACROS_H
# include <sys/sysmacros.h> /* For MIN, MAX, etc */
#endif
@@ -57,6 +53,14 @@ enum
# define IPTOS_MINCOST IPTOS_LOWCOST
#endif /* IPTOS_LOWDELAY */
+#ifndef MAXPATHLEN
+# ifdef PATH_MAX
+# define MAXPATHLEN PATH_MAX
+# else /* PATH_MAX */
+# define MAXPATHLEN 64 /* Should be safe */
+# endif /* PATH_MAX */
+#endif /* MAXPATHLEN */
+
/* Types */
/* If sys/types.h does not supply intXX_t, supply them ourselves */