summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1992-10-15 23:01:34 +0000
committerRoland McGrath <roland@redhat.com>1992-10-15 23:01:34 +0000
commitd3543bc097a8a86190b9f2126a1cee9a9cc98b63 (patch)
treeb12c1acb3031f0f6f16331247997ceecd83b3862 /misc.c
parent62477276781b64cf5fa8ad5936844fbe04693517 (diff)
downloadmake-d3543bc097a8a86190b9f2126a1cee9a9cc98b63.tar.gz
Formerly misc.c.~18~
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index f04ffe1..059d2db 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