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

Re: 4.0.3

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

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

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
 # 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;
-# 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)
+	    printf("memory size (kb)           ");
+#  else
 	    printf("virtual memory size (kb)   ");
+#  endif
 	if (limit != RLIM_INFINITY)
 	    limit /= 1024;

Peter Stephenson <pws@xxxxxxx>                  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 
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