From 22cbf1b2719c99c2f17a34859520dbead03e5799 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Fri, 4 Aug 2000 07:09:12 +0000 Subject: 15216: Rewrite pathconf() support. --- Src/system.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Src/system.h') diff --git a/Src/system.h b/Src/system.h index cba80a5f6..ba83e005e 100644 --- a/Src/system.h +++ b/Src/system.h @@ -194,8 +194,8 @@ struct timezone { # define VARARR(X,Y,Z) X *(Y) = (X *) alloca(sizeof(X) * (Z)) #endif -/* we should be getting this value from pathconf(_PC_PATH_MAX) */ -/* but this is too much trouble */ +/* we should handle unlimited sizes from pathconf(_PC_PATH_MAX) */ +/* but this is too much trouble */ #ifndef PATH_MAX # ifdef MAXPATHLEN # define PATH_MAX MAXPATHLEN @@ -204,6 +204,11 @@ struct timezone { # define PATH_MAX 1024 # endif #endif +#ifndef HAVE_PATHCONF +# define zpathmax(X) ((long)((strlen(X) >= PATH_MAX) ? \ + ((errno = ENAMETOOLONG), -1) : \ + ((errno = 0), PATH_MAX)) +#endif /* we should be getting this value from sysconf(_SC_OPEN_MAX) */ /* but this is too much trouble */ -- cgit 1.4.1