# HG changeset patch # User Richard M. Stallman # Date 841610830 0 # Node ID 53cf5adf7fd1e512ba41ab6b77923c3aac9ea914 # Parent a4c14fa6cb9dd1608799e529bcc5c284da1d0dcd [HAVE_SETRLIMIT]: Include time.h and resource.h. (main) [HAVE_SETRLIMIT]: Call setrlimit to extend the stack limit. New local `rlim'. diff -r a4c14fa6cb9d -r 53cf5adf7fd1 src/emacs.c --- a/src/emacs.c Sun Sep 01 20:46:31 1996 +0000 +++ b/src/emacs.c Sun Sep 01 20:47:10 1996 +0000 @@ -45,6 +45,11 @@ #include "syssignal.h" #include "process.h" +#ifdef HAVE_SETRLIMIT +#include +#include +#endif + #ifndef O_RDWR #define O_RDWR 2 #endif @@ -429,6 +434,9 @@ int skip_args = 0; extern int errno; extern sys_nerr; +#ifdef HAVE_SETRLIMIT + struct rlimit rlim; +#endif #ifdef LINUX_SBRK_BUG __sbrk (1); @@ -501,6 +509,15 @@ #endif /* LINK_CRTL_SHARE */ #endif /* VMS */ +#ifdef HAVE_SETRLIMIT + /* Extend the stack space available. */ + if (!getrlimit (RLIMIT_STACK, &rlim)) + { + rlim.rlim_cur = rlim.rlim_max; + setrlimit (RLIMIT_STACK, &rlim); + } +#endif + /* Record (approximately) where the stack begins. */ stack_bottom = &stack_bottom_variable;