From 81dd9d3ebc3eca04fade4df4689c53d1d11c5f19 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 18 Dec 2010 04:48:09 +1000 Subject: Detect undefined PATH_MAX POSIX does not require PATH_MAX be defined when there is not actual limit to its value. This affects HURD based systems. Work around this by defining PATH_MAX to 4096 (as on Linux) when this is not defined. Also, clean up inclusions of limits.h and remove autoconf check for this header as we do not use macro shields for its inclusion anyway. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- acinclude.m4 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'acinclude.m4') diff --git a/acinclude.m4 b/acinclude.m4 index 6693da44..7309d731 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -125,3 +125,19 @@ extern int getmntinfo (struct statfs **, int); [Defined as the filesystem stats type ('statvfs' or 'statfs')]) ]) +dnl Checks for PATH_MAX and defines it if not present +AC_DEFUN([PATH_MAX_DEFINED], + [AC_CACHE_CHECK([PATH_MAX defined], path_max_cv_defined, + [AC_EGREP_CPP(yes, [[ +#include +#if defined(PATH_MAX) +yes +#endif +]], + [path_max_cv_defined=yes], + [path_max_cv_defined=no])] + ) + if test $path_max_cv_defined = no; then + AC_DEFINE([PATH_MAX], 4096, [Define if PATH_MAX is undefined by limits.h.]) + fi +]) -- cgit v1.2.3-54-g00ecf