zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: Zefram <zefram@fysh.org>
Cc: zsh-workers@sunsite.dk
Subject: Re: PATCH: maxfilelocks in ulimit output
Date: Tue, 11 Feb 2003 23:03:38 -0500	[thread overview]
Message-ID: <20030212040338.GA19602@scowler.net> (raw)
In-Reply-To: <20030210093125.GB14223@fysh.org>

> 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 <sys/capability.h>
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)         ");


  parent reply	other threads:[~2003-02-12  4:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-09  1:06 Clint Adams
2003-02-09  1:41 ` Clint Adams
2003-02-09  2:25   ` Bart Schaefer
2003-02-09 17:29     ` Clint Adams
2003-02-09 22:45       ` Clint Adams
2003-02-10  9:08         ` Borzenkov Andrey
2003-02-10  9:31           ` Zefram
2003-02-10 10:47             ` Peter Stephenson
2003-02-12  4:03             ` Clint Adams [this message]
2003-02-12 11:09               ` Peter Stephenson
2003-02-16  4:52                 ` Clint Adams

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=20030212040338.GA19602@scowler.net \
    --to=clint@zsh.org \
    --cc=zefram@fysh.org \
    --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).