]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Formerly misc.c.~18~
authorRoland McGrath <roland@redhat.com>
Thu, 15 Oct 1992 23:01:34 +0000 (23:01 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 15 Oct 1992 23:01:34 +0000 (23:01 +0000)
misc.c

diff --git a/misc.c b/misc.c
index f04ffe1909eb5be1267568546bbeb77fe83e525c..059d2dbe466f5781850db6178267385088410ab2 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -596,3 +596,22 @@ child_access ()
   if (setgid (user_gid) < 0)
     pfatal_with_name ("setgid");
 }
+\f
+#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