zsh-workers
 help / color / mirror / code / Atom feed
From: Toby Peterson <toby@opendarwin.org>
To: zsh-workers@sunsite.dk
Subject: Patches for zsh on Mac OS X 10.4
Date: Sun, 3 Apr 2005 04:43:03 -0400	[thread overview]
Message-ID: <B8D4C05A-0D80-48F1-87FE-DAFCFBA69BDC@opendarwin.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

Two patches (against current CVS) included...

rlimit-rss-as.diff: RLIMIT_RSS and RLIMIT_AS are the same. Patch  
includes configure check and source changes.

utmpx-apple.diff: We now include utmpx, but the struct has no ut_name  
field. I suspect this issue may occur on other platforms... Solaris 9  
and Fedora Core 2 didn't appear to have the field either.

- Toby Peterson

[-- Attachment #2: rlimit-rss-as.diff --]
[-- Type: application/octet-stream, Size: 2173 bytes --]

Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.30
diff -u -r1.30 configure.ac
--- configure.ac	14 Mar 2005 10:51:17 -0000	1.30
+++ configure.ac	3 Apr 2005 08:37:44 -0000
@@ -1502,6 +1502,33 @@
 fi
 
 
+AH_TEMPLATE([RLIMIT_RSS_IS_AS],
+[Define to 1 if RLIMIT_RSS and RLIMIT_AS both exist and are equal.])
+AC_CACHE_CHECK(if RLIMIT_RSS and RLIMIT_AS are the same,
+zsh_cv_rlimit_rss_is_as,
+[AC_TRY_RUN([
+#include <sys/types.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/resource.h>
+int main()
+{
+int ret = 1;
+#if defined(HAVE_RLIMIT_RSS) && defined(HAVE_RLIMIT_AS)
+if (RLIMIT_AS == RLIMIT_RSS) ret = 0;
+#endif
+return ret;
+}],
+  zsh_cv_rlimit_rss_is_as=yes,
+  zsh_cv_rlimit_rss_is_as=no,
+  zsh_cv_rlimit_rss_is_as=no)])
+
+if test $zsh_cv_rlimit_rss_is_as = yes; then
+  AC_DEFINE(RLIMIT_RSS_IS_AS)
+fi
+
+
 dnl --------------------------------------------
 dnl Check for members of struct rusage
 dnl --------------------------------------------
Index: Src/Builtins/rlimits.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Builtins/rlimits.c,v
retrieving revision 1.13
diff -u -r1.13 rlimits.c
--- Src/Builtins/rlimits.c	19 Jan 2005 13:04:10 -0000	1.13
+++ Src/Builtins/rlimits.c	3 Apr 2005 08:37:44 -0000
@@ -242,7 +242,7 @@
 # endif /* HAVE_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(HAVE_RLIMIT_RSS) && !defined(RLIMIT_VMEM_IS_RSS)
+# if defined(HAVE_RLIMIT_RSS) && !defined(RLIMIT_VMEM_IS_RSS) && !defined(RLIMIT_RSS_IS_AS)
     case RLIMIT_RSS:
 	if (head)
 	    printf("-m: resident set size (kbytes) ");
@@ -834,7 +834,7 @@
 	    case RLIMIT_VMEM:
 # endif /* HAVE_RLIMIT_VMEM */
 /* ditto RLIMIT_VMEM and RLIMIT_AS */
-# if defined(HAVE_RLIMIT_AS) && !defined(RLIMIT_VMEM_IS_AS)
+# if defined(HAVE_RLIMIT_AS) && !defined(RLIMIT_VMEM_IS_AS) && !defined(RLIMIT_RSS_IS_AS)
 	    case RLIMIT_AS:
 # endif /* HAVE_RLIMIT_AS */
 # ifdef HAVE_RLIMIT_AIO_MEM

[-- Attachment #3: utmpx-apple.diff --]
[-- Type: application/octet-stream, Size: 512 bytes --]

Index: Src/watch.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/watch.c,v
retrieving revision 1.4
diff -u -r1.4 watch.c
--- Src/watch.c	2 Jun 2004 22:14:26 -0000	1.4
+++ Src/watch.c	3 Apr 2005 08:37:44 -0000
@@ -103,6 +103,9 @@
 # ifdef HAVE_STRUCT_UTMPX_UT_HOST
 #  define WATCH_UTMP_UT_HOST 1
 # endif
+# ifdef __APPLE__
+#  define ut_name ut_user
+# endif
 #endif
 
 #if !defined(WATCH_STRUCT_UTMP) && defined(HAVE_STRUCT_UTMP) && defined(REAL_UTMP_FILE)

             reply	other threads:[~2005-04-03  8:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-03  8:43 Toby Peterson [this message]
2005-04-04  9:57 ` Peter Stephenson

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=B8D4C05A-0D80-48F1-87FE-DAFCFBA69BDC@opendarwin.org \
    --to=toby@opendarwin.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).