changeset 18683:ec9c20bede0c

(main) [__NetBSD__]: Round up new stack limit to page bdry.
author Richard M. Stallman <rms@gnu.org>
date Wed, 09 Jul 1997 00:07:19 +0000
parents 28f77aef27b2
children 76bdd57b476d
files src/emacs.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/emacs.c	Wed Jul 09 00:04:00 1997 +0000
+++ b/src/emacs.c	Wed Jul 09 00:07:19 1997 +0000
@@ -584,6 +584,13 @@
       long newlim;
       /* Approximate the amount regex.c needs, plus some more.  */
       newlim = 800000 * sizeof (char *);
+#ifdef __NetBSD__
+      /* NetBSD (at least NetBSD 1.2G and former) has a bug in its
+       stack allocation routine for new process that the allocation
+       fails if stack limit is not on page boundary.  So, round up the
+       new limit to page boundary.  */
+      newlim = (newlim + getpagesize () - 1) / getpagesize () * getpagesize();
+#endif
       if (newlim > rlim.rlim_max)
 	newlim = rlim.rlim_max;
       if (rlim.rlim_cur < newlim)