summaryrefslogtreecommitdiff
path: root/nptl/pthread_getattr_np.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_getattr_np.c')
-rw-r--r--nptl/pthread_getattr_np.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c
index e79f282fee..fdcb54d605 100644
--- a/nptl/pthread_getattr_np.c
+++ b/nptl/pthread_getattr_np.c
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/resource.h>
-#include "pthreadP.h"
+#include <pthreadP.h>
#include <lowlevellock.h>
#include <ldsodefs.h>
@@ -34,7 +34,12 @@ pthread_getattr_np (thread_id, attr)
pthread_t thread_id;
pthread_attr_t *attr;
{
+#ifndef PTHREAD_T_IS_TID
struct pthread *thread = (struct pthread *) thread_id;
+#else
+ struct pthread *thread = __find_in_stack_list (thread_id);
+#endif
+
struct pthread_attr *iattr = (struct pthread_attr *) attr;
int ret = 0;
@@ -64,6 +69,9 @@ pthread_getattr_np (thread_id, attr)
}
else
{
+#ifdef GET_MAIN_STACK_INFO
+ ret = GET_MAIN_STACK_INFO (&iattr->stackaddr, &iattr->stacksize);
+#else
/* No stack information available. This must be for the initial
thread. Get the info in some magical way. */
assert (abs (thread->pid) == thread->tid);
@@ -147,6 +155,7 @@ pthread_getattr_np (thread_id, attr)
fclose (fp);
}
+#endif
}
iattr->flags |= ATTR_FLAG_STACKADDR;