From: Roland McGrath Date: Thu, 15 Oct 1992 23:01:34 +0000 (+0000) Subject: Formerly misc.c.~18~ X-Git-Tag: 3.70.2~569 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3543bc097a8a86190b9f2126a1cee9a9cc98b63;p=thirdparty%2Fmake.git Formerly misc.c.~18~ --- diff --git a/misc.c b/misc.c index f04ffe19..059d2dbe 100644 --- a/misc.c +++ b/misc.c @@ -596,3 +596,22 @@ child_access () if (setgid (user_gid) < 0) pfatal_with_name ("setgid"); } + +#ifdef NEED_GET_PATH_MAX +unsigned int +get_path_max () +{ + static unsigned int value; + + if (value == 0) + { + long int x = pathconf ("/", _PC_PATH_MAX); + if (x > 0) + value = x; + else + return MAXPATHLEN; + } + + return value; +} +#endif