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. --- nptl/pthread_getattr_np.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'nptl/pthread_getattr_np.c') diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c index dfacd887c9..9cc948f4c6 100644 --- a/nptl/pthread_getattr_np.c +++ b/nptl/pthread_getattr_np.c @@ -114,6 +114,11 @@ pthread_getattr_np (thread_id, attr) iattr->stacksize = rl.rlim_cur; iattr->stackaddr = (void *) to; + /* The limit might be too high. This is a bogus + situation but try to avoid making it worse. */ + if ((size_t) iattr->stacksize > (size_t) iattr->stackaddr) + iattr->stacksize = (size_t) iattr->stackaddr; + /* We succeed and no need to look further. */ ret = 0; break; @@ -127,6 +132,23 @@ pthread_getattr_np (thread_id, attr) iattr->flags |= ATTR_FLAG_STACKADDR; + if (ret == 0) + { + iattr->cpuset = (cpu_set_t *) malloc (sizeof (cpu_set_t)); + if (iattr->cpuset == NULL) + ret = ENOMEM; + else + { + ret = pthread_getaffinity_np (thread_id, iattr->cpuset); + if (ret == ENOSYS) + { + free (iattr->cpuset); + iattr->cpuset = NULL; + ret = 0; + } + } + } + lll_unlock (thread->lock); pthread_cleanup_pop (0); -- cgit v1.2.1