From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5765 invoked from network); 12 Feb 2003 04:03:51 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Feb 2003 04:03:51 -0000 Received: (qmail 12133 invoked by alias); 12 Feb 2003 04:03:42 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18226 Received: (qmail 12123 invoked from network); 12 Feb 2003 04:03:42 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 12 Feb 2003 04:03:42 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [207.99.30.4] by sunsite.dk (MessageWall 1.0.8) with SMTP; 12 Feb 2003 4:3:41 -0000 Received: from acolyte.scowler.net (localhost [127.0.0.1]) by acolyte.scowler.net (8.12.6/8.12.6/Debian-7) with ESMTP id h1C43fRe019612 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 11 Feb 2003 23:03:41 -0500 Received: (from clint@localhost) by acolyte.scowler.net (8.12.6/8.12.6/Debian-7) id h1C43cQI019611; Tue, 11 Feb 2003 23:03:38 -0500 X-Authentication-Warning: acolyte.scowler.net: clint set sender to clint@zsh.org using -f Date: Tue, 11 Feb 2003 23:03:38 -0500 From: Clint Adams To: Zefram Cc: zsh-workers@sunsite.dk Subject: Re: PATCH: maxfilelocks in ulimit output Message-ID: <20030212040338.GA19602@scowler.net> References: <20030209224506.GA25964@scowler.net> <6134254DE87BD411908B00A0C99B044F03A0B63B@mowd019a.mow.siemens.ru> <20030210093125.GB14223@fysh.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030210093125.GB14223@fysh.org> User-Agent: Mutt/1.4i > It's better not to rely on being able to run programs at configure time, > to allow for cross compilation. It may be better in this case to turn > the troublesome preprocessor conditionals into C conditionals -- gcc, > at least, will optimise them away. This works for me; untested on any other platform. cpu time (seconds) unlimited file size (blocks) unlimited data seg size (kbytes) unlimited stack size (kbytes) 8192 core file size (blocks) 0 resident set size (kbytes) unlimited processes 366 file descriptors 1024 locked-in-memory size (kb) unlimited address space (kb) unlimited file locks unlimited Index: Src/system.h =================================================================== RCS file: /cvsroot/zsh/zsh/Src/system.h,v retrieving revision 1.15 diff -u -r1.15 system.h --- Src/system.h 28 Apr 2001 17:38:01 -0000 1.15 +++ Src/system.h 11 Feb 2003 17:38:58 -0000 @@ -395,9 +395,6 @@ #if !defined(RLIMIT_NOFILE) && defined(RLIMIT_OFILE) # define RLIMIT_NOFILE RLIMIT_OFILE #endif -#if !defined(RLIMIT_VMEM) && defined(RLIMIT_AS) -# define RLIMIT_VMEM RLIMIT_AS -#endif #ifdef HAVE_SYS_CAPABILITY_H # include Index: Src/Builtins/rlimits.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Builtins/rlimits.c,v retrieving revision 1.8 diff -u -r1.8 rlimits.c --- Src/Builtins/rlimits.c 9 Feb 2003 01:12:38 -0000 1.8 +++ Src/Builtins/rlimits.c 11 Feb 2003 17:38:58 -0000 @@ -175,10 +175,16 @@ break; /* If RLIMIT_VMEM and RLIMIT_RSS are defined and equal, avoid * * duplicate case statement. Observed on QNX Neutrino 6.1.0. */ -# if defined(RLIMIT_RSS) && (!defined(RLIMIT_VMEM) || RLIMIT_VMEM != RLIMIT_RSS) +# ifdef RLIMIT_RSS case RLIMIT_RSS: - if (head) - printf("resident set size (kbytes) "); + if (head) { +# ifdef RLIMIT_VMEM + if (RLIMIT_VMEM == RLIMIT_RSS) + printf("memory size (kb) "); + else +# endif + printf("resident set size (kbytes) "); + } if (limit != RLIM_INFINITY) limit /= 1024; break; @@ -206,16 +212,12 @@ # ifdef RLIMIT_VMEM case RLIMIT_VMEM: if (head) -# if defined(RLIMIT_RSS) && RLIMIT_VMEM == RLIMIT_RSS - printf("memory size (kb) "); -# else printf("virtual memory size (kb) "); -# endif if (limit != RLIM_INFINITY) limit /= 1024; break; # endif /* RLIMIT_VMEM */ -# if defined RLIMIT_AS && RLIMIT_AS != RLIMIT_VMEM +# ifdef RLIMIT_AS case RLIMIT_AS: if (head) printf("address space (kb) ");