46 |
# include <fcntl.h> |
# include <fcntl.h> |
47 |
#endif |
#endif |
48 |
|
|
49 |
|
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) |
50 |
|
# define SET_STACK_SIZE |
51 |
|
#endif |
52 |
|
|
53 |
|
#ifdef SET_STACK_SIZE |
54 |
|
# include <sys/resource.h> |
55 |
|
#endif |
56 |
|
|
57 |
#ifdef _AMIGA |
#ifdef _AMIGA |
58 |
int __stack = 20000; /* Make sure we have 20K of stack space */ |
int __stack = 20000; /* Make sure we have 20K of stack space */ |
59 |
#endif |
#endif |
889 |
no_default_sh_exe = 1; |
no_default_sh_exe = 1; |
890 |
#endif |
#endif |
891 |
|
|
892 |
|
#ifdef SET_STACK_SIZE |
893 |
|
/* Get rid of any avoidable limit on stack size. */ |
894 |
|
{ |
895 |
|
struct rlimit rlim; |
896 |
|
|
897 |
|
/* Set the stack limit huge so that alloca does not fail. */ |
898 |
|
if (getrlimit (RLIMIT_STACK, &rlim) == 0) |
899 |
|
{ |
900 |
|
rlim.rlim_cur = rlim.rlim_max; |
901 |
|
setrlimit (RLIMIT_STACK, &rlim); |
902 |
|
} |
903 |
|
} |
904 |
|
#endif |
905 |
|
|
906 |
/* Needed for OS/2 */ |
/* Needed for OS/2 */ |
907 |
initialize_main(&argc, &argv); |
initialize_main(&argc, &argv); |
908 |
|
|