From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6202 invoked from network); 15 Nov 2002 12:57:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Nov 2002 12:57:55 -0000 Received: (qmail 24118 invoked by alias); 15 Nov 2002 12:57:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17941 Received: (qmail 24109 invoked from network); 15 Nov 2002 12:57:47 -0000 From: jarausch@igpm.rwth-aachen.de Message-Id: <200211151257.NAA47648@numa1.igpm.rwth-aachen.de> Date: Fri, 15 Nov 2002 13:57:18 +0100 Reply-To: jarausch@igpm.rwth-aachen.de Subject: Re: ulimit strangeness To: pws@csr.com cc: zsh-workers@sunsite.dk In-Reply-To: <23083.1037361354@csr.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii On 15 Nov, Peter Stephenson wrote: > "Bart Schaefer" wrote: >> zsh% ulimit -v $[200*1024]; limit >> cputime unlimited >> filesize unlimited >> datasize unlimited >> stacksize 8MB >> coredumpsize unlimited >> memoryuse unlimited >> maxproc 2040 >> descriptors 1024 >> memorylocked unlimited >> addressspace 200kB <-- Note, not 200 megabytes! >> >> It looks like this has something to do with the convoluted #ifdef that >> prevents duplicate case labels in rlimits.c when both RLIMIT_RSS and >> RLIMIT_VMEM are defined, but I haven't yet figured out what to fix. > > My guess is the test `RLIMIT_RSS != RLIMIT_VMEM' is incorrectly failing > in the preprocessor, i.e. it thinks RLIMIT_RSS == RLIMIT_VMEM owing to > the way the definitions are laid out. Checking > /usr/include/sys/resource.h or carefully hidden equivalent should > confirm or refute this. The following programme might help. > > #include > #include > > int main(int argc, char **argv) > { > #if defined(RLIMIT_RSS) && defined(RLIMIT_VMEM) > printf("You have both definitions.\n"); > if (RLIMIT_RSS == RLIMIT_VMEM) > { > printf("Both have the same value.\n"); > } > else > { > printf("They have different values.\n"); > #if RLIMIT_RSS == RLIMIT_VMEM > printf("!!!You should never see this message!!!\n"); > #endif > } > #else > #ifdef RLIMIT_RSS > printf("You only have RSS\n"); > #else > #ifdef RLIMIT_VMEM > printf("You only have VMEM\n"); > #else > printf("You have neither definition.\n"); > #endif > #endif > #endif > > return 0; > } > > We could probe this more reliably than at present in configure. > Here on my machine (Linux-From-Scratch 2.4.20-rc1 glibc 2.2.5) I get You only have RSS. Thanks, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik Aachen University D 52056 Aachen, Germany