comparison src/emacs.c @ 16046:53cf5adf7fd1

[HAVE_SETRLIMIT]: Include time.h and resource.h. (main) [HAVE_SETRLIMIT]: Call setrlimit to extend the stack limit. New local `rlim'.
author Richard M. Stallman <rms@gnu.org>
date Sun, 01 Sep 1996 20:47:10 +0000
parents 1757da8f8f31
children d76a0697d12e
comparison
equal deleted inserted replaced
16045:a4c14fa6cb9d 16046:53cf5adf7fd1
42 42
43 #include "systty.h" 43 #include "systty.h"
44 #include "blockinput.h" 44 #include "blockinput.h"
45 #include "syssignal.h" 45 #include "syssignal.h"
46 #include "process.h" 46 #include "process.h"
47
48 #ifdef HAVE_SETRLIMIT
49 #include <sys/time.h>
50 #include <sys/resource.h>
51 #endif
47 52
48 #ifndef O_RDWR 53 #ifndef O_RDWR
49 #define O_RDWR 2 54 #define O_RDWR 2
50 #endif 55 #endif
51 56
427 { 432 {
428 char stack_bottom_variable; 433 char stack_bottom_variable;
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);
435 #endif 443 #endif
436 444
498 if (!environ) 506 if (!environ)
499 environ = envp; 507 environ = envp;
500 #endif /* SHARABLE_LIB_BUG */ 508 #endif /* SHARABLE_LIB_BUG */
501 #endif /* LINK_CRTL_SHARE */ 509 #endif /* LINK_CRTL_SHARE */
502 #endif /* VMS */ 510 #endif /* VMS */
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
503 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
507 #ifdef RUN_TIME_REMAP 524 #ifdef RUN_TIME_REMAP