]> git.pld-linux.org Git - packages/glibc.git/blame - glibc-setrlimit.patch
- damn, wrong branch
[packages/glibc.git] / glibc-setrlimit.patch
CommitLineData
3de185ca 12002-09-28 Roland McGrath <roland@redhat.com>
2
3 * pthread.c (__pthread_reset_main_thread) [FLOATING_STACKS]:
4 Don't call setrlimit, since we did no prior bogon we need to undo.
5
6--- libc/linuxthreads/pthread.c 20 Sep 2002 20:04:23 -0000 1.105
7+++ libc/linuxthreads/pthread.c 28 Sep 2002 21:58:05 -0000 1.106
8@@ -1044,7 +1044,6 @@ static void pthread_handle_sigdebug(int
9 void __pthread_reset_main_thread(void)
10 {
11 pthread_descr self = thread_self();
12- struct rlimit limit;
13
14 if (__pthread_manager_request != -1) {
15 /* Free the thread manager stack */
16@@ -1069,11 +1068,19 @@ void __pthread_reset_main_thread(void)
17 THREAD_SETMEM(self, p_resp, &_res);
18 #endif
19
20- if (getrlimit (RLIMIT_STACK, &limit) == 0
21- && limit.rlim_cur != limit.rlim_max) {
22- limit.rlim_cur = limit.rlim_max;
23- setrlimit(RLIMIT_STACK, &limit);
24- }
25+#ifndef FLOATING_STACKS
26+ /* This is to undo the setrlimit call in __pthread_init_max_stacksize.
27+ XXX This can be wrong if the user set the limit during the run. */
28+ {
29+ struct rlimit limit;
30+ if (getrlimit (RLIMIT_STACK, &limit) == 0
31+ && limit.rlim_cur != limit.rlim_max)
32+ {
33+ limit.rlim_cur = limit.rlim_max;
34+ setrlimit(RLIMIT_STACK, &limit);
35+ }
36+ }
37+#endif
38 }
39
40 /* Process-wide exec() request */
This page took 0.057712 seconds and 4 git commands to generate.