summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2005-02-26 18:54:07 +0000
committerNed Ludd <solar@gentoo.org>2005-02-26 18:54:07 +0000
commit5533874b8f94639fca8d465586d744907d9b969e (patch)
treef267e75c9bdc27eccdcd86c9ac9b345d09038807 /extra
parente000cb429e08b4e2d837bfce4bfffe1b08796cdf (diff)
- avoid segfaulting when rlimit stack is set to low for gen_wctype by calling setrlimit(RLIMIT_STACK, &limit)
Diffstat (limited to 'extra')
-rw-r--r--extra/locale/gen_wctype.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/extra/locale/gen_wctype.c b/extra/locale/gen_wctype.c
index ab5c5dd78..e0df4e88c 100644
--- a/extra/locale/gen_wctype.c
+++ b/extra/locale/gen_wctype.c
@@ -10,6 +10,10 @@
#include <wchar.h>
#include <ctype.h>
+#ifdef __linux__
+#include <sys/resource.h>
+#endif
+
#ifndef _CTYPE_H
#define _CTYPE_H
#endif
@@ -243,6 +247,14 @@ int main(int argc, char **argv)
static const char empty_slot[] = "empty_slot";
int built = 0;
+#ifdef __linux__
+ struct rlimit limit;
+
+ limit.rlim_max = RLIM_INFINITY;
+ limit.rlim_cur = RLIM_INFINITY;
+ setrlimit(RLIMIT_STACK, &limit);
+#endif
+
#define INIT_TYPENAME(X) typename[__CTYPE_##X] = "C_" #X
for (i=0 ; i < 16 ; i++) {