pthread_getattr_np does not work

xuelin.tian at xuelin.tian at
Wed Sep 20 06:45:44 UTC 2017

I need to get thread attributes through this function. 

#define __GNU_VISIBLE
#include <pthread.h>

test_thread (guint8 **staddr, size_t *stsize)
pthread_attr_t attr;
uint8_t **staddr = NULL;
size_t *stsize = 0;
        int res = 0;

res = pthread_getattr_np (pthread_self(), &attr);
pthread_attr_getstack (&attr, (void**)staddr, stsize);
pthread_attr_destroy (&attr);

I check the return value is 0 which means pthread_getattr_np goes well. But all values in attr structure are either 0 or 1. And I can not get staddr and stsize value either.

So, I think there may be something wrong with this function.

Best wishes,
xuelin.tian at
From: Sebastian Huber
Date: 2017-09-20 13:00
To: xuelin.tian at; users at
Subject: Re: pthread_getattr_np does not work
On 20/09/17 05:43, xuelin.tian at wrote:
> Dear all,
> I tried to use pthread_getattr_np function to extract attrributes of 
> thread in rtems, but it does not work. Has anyone used this function 
> before?
What do you mean with doesn't work?
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at
PGP     : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list