From 06f6ca9019897f5d1799c0ae8d7293ed249c0f97 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 17 Sep 2003 18:23:49 +0000 Subject: Update. 2003-09-17 Philip Blundell * sysdeps/unix/sysv/linux/arm/vfork.S: Branch to fork if libpthread is loaded. Elide backwards compatibility code when not required. --- linuxthreads/attr.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'linuxthreads/attr.c') diff --git a/linuxthreads/attr.c b/linuxthreads/attr.c index a66eb72c27..687334ffdb 100644 --- a/linuxthreads/attr.c +++ b/linuxthreads/attr.c @@ -404,7 +404,11 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr) # endif #endif +#ifdef USE_TLS if (attr->__stackaddr == NULL) +#else + if (descr == &__pthread_initial_thread) +#endif { /* Defined in ld.so. */ extern void *__libc_stack_end; @@ -448,6 +452,11 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr) attr->__stacksize = rl.rlim_cur; attr->__stackaddr = (void *) to; + /* The limit might be too high. This is a bogus + situation but try to avoid making it worse. */ + if ((size_t) attr->__stacksize > (size_t) attr->__stackaddr) + attr->__stacksize = (size_t) attr->__stackaddr; + /* We succeed and no need to look further. */ ret = 0; break; -- cgit 1.4.1