Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ulimit strangeness

"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 <stdio.h>
  #include <sys/resource.h>

  int main(int argc, char **argv)
  #if defined(RLIMIT_RSS) && defined(RLIMIT_VMEM)
      printf("You have both definitions.\n");
	  printf("Both have the same value.\n");
	  printf("They have different values.\n");
	  printf("!!!You should never see this message!!!\n");
  #ifdef RLIMIT_RSS
      printf("You only have RSS\n");
  #ifdef RLIMIT_VMEM
      printf("You only have VMEM\n");
      printf("You have neither definition.\n");

      return 0;

We could probe this more reliably than at present in configure.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

Messages sorted by: Reverse Date, Date, Thread, Author