Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 4.0.3
- X-seq: zsh-workers 16145
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: 4.0.3
- Date: Thu, 25 Oct 2001 11:54:49 +0100
- In-reply-to: "Mads Martin Joergensen"'s message of "Thu, 25 Oct 2001 12:29:02 +0200." <20011025122902.B16616@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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 <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
prohibited.
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