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

Re: PATCH: maxfilelocks in ulimit output



> 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)         ");



Messages sorted by: Reverse Date, Date, Thread, Author