From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1316 invoked from network); 31 Mar 2003 10:16:41 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 31 Mar 2003 10:16:41 -0000 Received: (qmail 19278 invoked by alias); 31 Mar 2003 10:16:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18408 Received: (qmail 19267 invoked from network); 31 Mar 2003 10:16:32 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 31 Mar 2003 10:16:32 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 31 Mar 2003 10:16:32 -0000 Received: from exchange01.csr.com (unverified) by (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Mon, 31 Mar 2003 11:24:49 +0100 Received: from csr.com (tinky-winky.csr.com [192.168.144.127]) by exchange01.csr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id H5TXDQMN; Mon, 31 Mar 2003 11:15:42 +0100 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: RLIMITS macros Date: Mon, 31 Mar 2003 11:16:30 +0100 Message-ID: <17652.1049105790@csr.com> From: Peter Stephenson Attempt to fix the clashing limits problem. Could someone affected please try it? Index: zshconfig.ac =================================================================== RCS file: /cvsroot/zsh/zsh/zshconfig.ac,v retrieving revision 1.35 diff -u -r1.35 zshconfig.ac --- zshconfig.ac 24 Mar 2003 12:56:59 -0000 1.35 +++ zshconfig.ac 31 Mar 2003 10:13:56 -0000 @@ -1221,6 +1221,65 @@ AC_DEFINE_UNQUOTED(rlim_t, $DEFAULT_RLIM_T) fi + +dnl On some systems the RLIMIT_* are macros which don't evaluate +dnl to integers at compile time. In this case we are not able to +dnl do preprocessor comparisions and need our tests to determine +dnl if there are clashing definitions. +AC_CACHE_CHECK(if RLIMIT_VMEM and RLIMIT_RSS are the same, +zsh_cv_rlimit_vmem_is_rss, +[AC_TRY_RUN([ +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +int main() +{ +int ret = 1; +#ifdef RLIMIT_VMEM +#ifdef RLIMIT_RSS +if (RLIMIT_RSS == RLIMIT_VMEM) ret = 0; +#endif +#endif +return ret; +}], + zsh_cv_rlimit_vmem_is_rss=yes, + zsh_cv_rlimit_vmem_is_rss=no, + zsh_cv_rlimit_vmem_is_rss=no)]) + +if test $zsh_cv_rlimit_vmem_is_rss = yes; then + AC_DEFINE(RLIMIT_VMEM_IS_RSS) +fi + + +AC_CACHE_CHECK(if RLIMIT_VMEM and RLIMIT_AS are the same, +zsh_cv_rlimit_vmem_is_as, +[AC_TRY_RUN([ +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +int main() +{ +int ret = 1; +#ifdef RLIMIT_VMEM +#ifdef RLIMIT_AS +if (RLIMIT_AS == RLIMIT_VMEM) ret = 0; +#endif +#endif +return ret; +}], + zsh_cv_rlimit_vmem_is_as=yes, + zsh_cv_rlimit_vmem_is_as=no, + zsh_cv_rlimit_vmem_is_as=no)]) + +if test $zsh_cv_rlimit_vmem_is_as = yes; then + AC_DEFINE(RLIMIT_VMEM_IS_AS) +fi + + dnl ---------------------------- dnl CHECK FOR /dev/fd FILESYSTEM dnl ---------------------------- Index: acconfig.h =================================================================== RCS file: /cvsroot/zsh/zsh/acconfig.h,v retrieving revision 1.14 diff -u -r1.14 acconfig.h --- acconfig.h 6 May 2002 14:50:10 -0000 1.14 +++ acconfig.h 31 Mar 2003 10:13:56 -0000 @@ -238,6 +238,12 @@ /* Define to the type used in struct rlimit */ #undef rlim_t +/* Define to 1 if RLIMIT_VMEM and RLIMIT_RSS both exist and are equal */ +#undef RLIMIT_VMEM_IS_RSS + +/* Define to 1 if RLIMIT_VMEM and RLIMIT_AS both exist and are equal */ +#undef RLIMIT_VMEM_IS_AS + /* Define to 1 if /bin/sh does not interpret \ escape sequences */ #undef SH_USE_BSD_ECHO 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 31 Mar 2003 10:13:56 -0000 @@ -175,7 +175,7 @@ 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) +# if defined(RLIMIT_RSS) && !defined(RLIMIT_VMEM_IS_RSS) case RLIMIT_RSS: if (head) printf("resident set size (kbytes) "); @@ -206,7 +206,7 @@ # ifdef RLIMIT_VMEM case RLIMIT_VMEM: if (head) -# if defined(RLIMIT_RSS) && RLIMIT_VMEM == RLIMIT_RSS +# if defined(RLIMIT_RSS) && defined(RLIMIT_VMEM_IS_RSS) printf("memory size (kb) "); # else printf("virtual memory size (kb) "); @@ -215,7 +215,7 @@ limit /= 1024; break; # endif /* RLIMIT_VMEM */ -# if defined RLIMIT_AS && RLIMIT_AS != RLIMIT_VMEM +# if defined RLIMIT_AS && !defined(RLIMIT_VMEM_IS_AS) case RLIMIT_AS: if (head) printf("address space (kb) "); @@ -579,7 +579,7 @@ # endif /* RLIMIT_MEMLOCK */ /* If RLIMIT_VMEM and RLIMIT_RSS are defined and equal, avoid * * duplicate case statement. Observed on QNX Neutrino 6.1.0. */ -# if defined(RLIMIT_VMEM) && (!defined(RLIMIT_RSS) || RLIMIT_RSS != RLIMIT_VMEM) +# if defined(RLIMIT_VMEM) && !defined(RLIMIT_VMEM_IS_RSS) case RLIMIT_VMEM: # endif /* RLIMIT_VMEM */ # ifdef RLIMIT_AIO_MEM -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** 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. **********************************************************************