aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-01 20:47:10 +0000
committerRichard M. Stallman1996-09-01 20:47:10 +0000
commit53c58b5d489f21fdeb5f3d011e34638f8124fb91 (patch)
tree336ec5895d85833b5c7046e28a0c317c2893bcd9 /src
parent149d4fe55c72f75c66257514ea3e0707592b479b (diff)
downloademacs-53c58b5d489f21fdeb5f3d011e34638f8124fb91.tar.gz
emacs-53c58b5d489f21fdeb5f3d011e34638f8124fb91.zip
[HAVE_SETRLIMIT]: Include time.h and resource.h.
(main) [HAVE_SETRLIMIT]: Call setrlimit to extend the stack limit. New local `rlim'.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 2934750130f..57e581d142d 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -45,6 +45,11 @@ Boston, MA 02111-1307, USA. */
45#include "syssignal.h" 45#include "syssignal.h"
46#include "process.h" 46#include "process.h"
47 47
48#ifdef HAVE_SETRLIMIT
49#include <sys/time.h>
50#include <sys/resource.h>
51#endif
52
48#ifndef O_RDWR 53#ifndef O_RDWR
49#define O_RDWR 2 54#define O_RDWR 2
50#endif 55#endif
@@ -429,6 +434,9 @@ main (argc, argv, envp)
429 int skip_args = 0; 434 int skip_args = 0;
430 extern int errno; 435 extern int errno;
431 extern sys_nerr; 436 extern sys_nerr;
437#ifdef HAVE_SETRLIMIT
438 struct rlimit rlim;
439#endif
432 440
433#ifdef LINUX_SBRK_BUG 441#ifdef LINUX_SBRK_BUG
434 __sbrk (1); 442 __sbrk (1);
@@ -501,6 +509,15 @@ main (argc, argv, envp)
501#endif /* LINK_CRTL_SHARE */ 509#endif /* LINK_CRTL_SHARE */
502#endif /* VMS */ 510#endif /* VMS */
503 511
512#ifdef HAVE_SETRLIMIT
513 /* Extend the stack space available. */
514 if (!getrlimit (RLIMIT_STACK, &rlim))
515 {
516 rlim.rlim_cur = rlim.rlim_max;
517 setrlimit (RLIMIT_STACK, &rlim);
518 }
519#endif
520
504 /* Record (approximately) where the stack begins. */ 521 /* Record (approximately) where the stack begins. */
505 stack_bottom = &stack_bottom_variable; 522 stack_bottom = &stack_bottom_variable;
506 523