From: wessels <> Date: Sat, 1 Feb 1997 03:28:17 +0000 (+0000) Subject: setrlimit RLIMIT_VMEM X-Git-Tag: SQUID_3_0_PRE1~5162 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad7ef91afc84f38d0e5cfe459725b3b24e364dc7;p=thirdparty%2Fsquid.git setrlimit RLIMIT_VMEM --- diff --git a/src/tools.cc b/src/tools.cc index acd9eb4e9d..289272f10e 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.94 1997/01/13 22:58:04 wessels Exp $ + * $Id: tools.cc,v 1.95 1997/01/31 20:28:17 wessels Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -626,6 +626,17 @@ setMaxFD(void) } } #endif /* RLIMIT_DATA */ +#if HAVE_SETRLIMIT && defined(RLIMIT_VMEM) + if (getrlimit(RLIMIT_VMEM, &rl) < 0) { + debug(50, 0, "getrlimit: RLIMIT_VMEM: %s\n", xstrerror()); + } else { + rl.rlim_cur = rl.rlim_max; /* set it to the max */ + if (setrlimit(RLIMIT_VMEM, &rl) < 0) { + sprintf(tmp_error_buf, "setrlimit: RLIMIT_VMEM: %s", xstrerror()); + fatal_dump(tmp_error_buf); + } + } +#endif /* RLIMIT_VMEM */ } time_t