Re: PATCH: tools.c assumes RLIMIT_NOFILE or RLIMIT_OFILE if HAVE_SETRLIMIT

From: Robert Collins <robert.collins@dont-contact.us>
Date: Mon, 12 Mar 2001 22:23:42 +1100

Sorry for the noise folks,
skip this patch: it's bad because it might end up with no declaration of
struct rlimit rl...

My problem was a /usr/local/include/sys/resource.h that snuck in from
somewhere, combined with an updated gcc spec file that grabs
usr/local/include before /usr/include :[

I still suspect the assumption may be dangerous, but not knowing the
rlimit API I won't comment further without research.

Rob

----- Original Message -----
From: "Robert Collins" <robert.collins@itdomain.com.au>
To: <squid-dev@squid-cache.org>
Sent: Monday, March 12, 2001 10:10 PM
Subject: PATCH: tools.c assumes RLIMIT_NOFILE or RLIMIT_OFILE if
HAVE_SETRLIMIT

> for some reason, I have a broken SETRLIMIT environment - the struct
> rlimit is undefined. Whilst I'm looking into that, IMO we shouldn'
> assume that HAVE_SETRLIMIT implies RLIMIT_NOFILE || RLIMIT_OFILE...
>
> Rob
>
> Index: src/tools.c
> ===================================================================
> RCS file: /cvsroot/squid/squid/src/tools.c,v
> retrieving revision 1.11
> diff -u -r1.11 tools.c
> --- src/tools.c 2001/02/15 21:09:17 1.11
> +++ src/tools.c 2001/03/12 11:08:45
> @@ -626,7 +626,7 @@
> void
> setMaxFD(void)
> {
> -#if HAVE_SETRLIMIT
> +#if HAVE_SETRLIMIT && (defined(RLIMIT_NOFILE) ||
defined(RLIMIT_OFILE))
> /* try to use as many file descriptors as possible */
> /* System V uses RLIMIT_NOFILE and BSD uses RLIMIT_OFILE */
> struct rlimit rl;
>
>
Received on Mon Mar 12 2001 - 04:24:22 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:37 MST