aboutsummaryrefslogtreecommitdiff
path: root/nptl/pthread_getattr_np.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-09-17 18:23:49 +0000
committerUlrich Drepper <drepper@redhat.com>2003-09-17 18:23:49 +0000
commit06f6ca9019897f5d1799c0ae8d7293ed249c0f97 (patch)
tree9a04e5058de47ce0898cf279205c8e58735efb96 /nptl/pthread_getattr_np.c
parent65af7e61427ce9bbbc0e43b2ad44e5b4678a37fc (diff)
downloadglibc-06f6ca9019897f5d1799c0ae8d7293ed249c0f97.tar
glibc-06f6ca9019897f5d1799c0ae8d7293ed249c0f97.tar.gz
glibc-06f6ca9019897f5d1799c0ae8d7293ed249c0f97.tar.bz2
glibc-06f6ca9019897f5d1799c0ae8d7293ed249c0f97.zip
Update.
2003-09-17 Philip Blundell <philb@gnu.org> * sysdeps/unix/sysv/linux/arm/vfork.S: Branch to fork if libpthread is loaded. Elide backwards compatibility code when not required.
Diffstat (limited to 'nptl/pthread_getattr_np.c')
-rw-r--r--nptl/pthread_getattr_np.c22
1 files changed, 22 insertions, 0 deletions
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);