(main) [HAVE_SETRLIMIT]: Call setrlimit to extend the stack limit.
New local `rlim'.
#include "syssignal.h"
#include "process.h"
+#ifdef HAVE_SETRLIMIT
+#include <sys/time.h>
+#include <sys/resource.h>
+#endif
+
#ifndef O_RDWR
#define O_RDWR 2
#endif
int skip_args = 0;
extern int errno;
extern sys_nerr;
+#ifdef HAVE_SETRLIMIT
+ struct rlimit rlim;
+#endif
#ifdef LINUX_SBRK_BUG
__sbrk (1);
#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;