diff options
author | Richard Henderson <rth@redhat.com> | 2006-06-19 15:34:10 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-06-19 15:34:10 +0000 |
commit | f611b4677e45b3ff208b4a68e6efdc81ef577860 (patch) | |
tree | c7ef0b136348e0ffd7ee503be060cfa6811c2af3 | |
parent | 3cda30bc0b047012b90e967b624cb23ad4db243f (diff) |
svn merge -r114642:114643 svn+ssh://gcc.gnu.org/svn/gcc/trunk
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_1-branch@114776 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libgomp/ChangeLog | 6 | ||||
-rw-r--r-- | libgomp/env.c | 26 |
2 files changed, 22 insertions, 10 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 244cf534f56..24669979db0 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2006-06-14 Richard Henderson <rth@redhat.com> + + PR libgomp/28008 + * env.c (initialize_env): Avoid using PTHREAD_STACK_MIN when + undefined. Use GOMP_STACKSIZE not OMP_STACKSIZE for environment. + 2006-06-09 Richard Henderson <rth@redhat.com> * env.c (gomp_nthreads_var): Change to unsigned long. diff --git a/libgomp/env.c b/libgomp/env.c index d42e68e6a3c..c86ebc6d855 100644 --- a/libgomp/env.c +++ b/libgomp/env.c @@ -166,21 +166,27 @@ initialize_env (void) pthread_attr_init (&gomp_thread_attr); pthread_attr_setdetachstate (&gomp_thread_attr, PTHREAD_CREATE_DETACHED); - if (parse_unsigned_long ("OMP_STACKSIZE", &stacksize)) + if (parse_unsigned_long ("GOMP_STACKSIZE", &stacksize)) { + int err; + stacksize *= 1024; - if (stacksize < PTHREAD_STACK_MIN) - gomp_error ("Stack size less than minimum of %luk", - PTHREAD_STACK_MIN / 1024ul - + (PTHREAD_STACK_MIN % 1024 != 0)); - else + err = pthread_attr_setstacksize (&gomp_thread_attr, stacksize); + +#ifdef PTHREAD_STACK_MIN + if (err == EINVAL) { - int err = pthread_attr_setstacksize (&gomp_thread_attr, stacksize); - if (err == EINVAL) + if (stacksize < PTHREAD_STACK_MIN) + gomp_error ("Stack size less than minimum of %luk", + PTHREAD_STACK_MIN / 1024ul + + (PTHREAD_STACK_MIN % 1024 != 0)); + else gomp_error ("Stack size larger than system limit"); - else if (err != 0) - gomp_error ("Stack size change failed: %s", strerror (err)); } + else +#endif + if (err != 0) + gomp_error ("Stack size change failed: %s", strerror (err)); } } |