zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: 4.0.3
Date: Thu, 25 Oct 2001 11:54:49 +0100	[thread overview]
Message-ID: <4121.1004007289@csr.com> (raw)
In-Reply-To: "Mads Martin Joergensen"'s message of "Thu, 25 Oct 2001 12:29:02 +0200." <20011025122902.B16616@staudinger.suse.de>

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@csr.com>                  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.
**********************************************************************


  reply	other threads:[~2001-10-25 10:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-24 17:30 4.0.3 Peter Stephenson
2001-10-24 17:57 ` 4.0.3 Bart Schaefer
2001-10-24 19:05   ` 4.0.3 Trond Eivind Glomsrød
2001-10-24 23:38     ` Re[2]: 4.0.3 S. Cowles
2001-10-25  4:56       ` Borsenkow Andrej
2001-10-25 10:29 ` 4.0.3 Mads Martin Joergensen
2001-10-25 10:54   ` Peter Stephenson [this message]
2001-10-25 11:00     ` 4.0.3 Borsenkow Andrej
2001-10-25 11:20       ` 4.0.3 Peter Stephenson
2001-10-25 11:23         ` 4.0.3 Borsenkow Andrej
2001-10-25 12:23           ` 4.0.3 Trond Eivind Glomsrød
2001-10-25 13:24           ` 4.0.3 Peter Stephenson
2001-10-25 11:19     ` 4.0.3 Mads Martin Joergensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4121.1004007289@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).