From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4879 invoked from network); 25 Oct 2001 10:55:37 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 25 Oct 2001 10:55:37 -0000 Received: (qmail 17681 invoked by alias); 25 Oct 2001 10:55:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16145 Received: (qmail 17652 invoked from network); 25 Oct 2001 10:55:26 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: 4.0.3 In-reply-to: "Mads Martin Joergensen"'s message of "Thu, 25 Oct 2001 12:29:02 +0200." <20011025122902.B16616@staudinger.suse.de> Date: Thu, 25 Oct 2001 11:54:49 +0100 Message-ID: <4121.1004007289@csr.com> From: Peter Stephenson Mads Martin Joergensen wrote: > How come the following stops working in 4.0.3, according to the manpage > it is correct: > > (mmj@staudinger) ~> ulimit -Sm unlimited > ulimit: bad option: -m > zsh: exit 1 -m corresponds to the internal definition RLIMIT_RSS, see /usr/include/sys/resource.h. Are you on a system where RLIMIT_VMEM == RLIMIT_RSS? If so, this is the effect of 16033. (If not, nothing should have changed since 4.0.2.) Probably the best thing to do is handle this as a special case, as follows --- this applies to both branches. I changed the output message for the case in question, since it obviously doesn't make sense to discriminate between virtual and physical memory here. I can't really test this here, I don't have RLIMIT_RSS. Not sure if this is enough to upgrade 4.0.3 to 4.0.4, but at least I haven't announced 4.0.3 yet. Index: Src/Builtins/rlimits.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Builtins/rlimits.c,v retrieving revision 1.3 diff -u -r1.3 rlimits.c --- Src/Builtins/rlimits.c 2001/10/22 17:18:29 1.3 +++ Src/Builtins/rlimits.c 2001/10/25 10:49:25 @@ -44,12 +44,6 @@ # include "rlimits.h" -/* If RLIMIT_VMEM and RLIMIT_RSS are defined and equal, drop support * - * for RLIMIT_RSS. Observed on QNX Neutrino 6.1.0. */ -#if defined(RLIMIT_RSS) && defined(RLIMIT_VMEM) && (RLIMIT_RSS == RLIMIT_VMEM) -#undef RLIMIT_RSS -#endif - # if defined(RLIM_T_IS_QUAD_T) || defined(RLIM_T_IS_LONG_LONG) || defined(RLIM_T_IS_UNSIGNED) static rlim_t zstrtorlimt(const char *s, char **t, int base) @@ -174,7 +168,9 @@ if (limit != RLIM_INFINITY) limit /= 512; break; -# ifdef RLIMIT_RSS +/* 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) case RLIMIT_RSS: if (head) printf("resident set size (kbytes) "); @@ -205,7 +201,11 @@ # 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; -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** 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 prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************