pthread_getattr_np does not work

xuelin.tian at qkmtech.com xuelin.tian at qkmtech.com
Wed Sep 20 07:15:11 UTC 2017


I can not reply to rtems-devel mail list, so I have to send again.

Sorry for the rush reply eariler.

I do know this is a bug or I just use it in a wrong way. I need to make sure that no one has encountered this problem like me before, then I will report a bug.



Best wishes,
xuelin.tian at qkmtech.com
 
From: Sebastian Huber
Date: 2017-09-20 14:30
To: 
CC: xuelin.tian at qkmtech.com; RTEMS
Subject: Re: pthread_getattr_np does not work
Hello Xuelin,
 
please answer to the mailing list.
 
 
On 20/09/17 08:20, xuelin.tian at qkmtech.com wrote:
> I need to get thread attributes through this function.
>
> **********************************************************************
> #define __GNU_VISIBLE
> #include <pthread.h>
>
> void
> 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.
 
Maybe the stack related parts are not returned by pthread_getattr_np(). 
Please add a ticket for this. You may also implement the missing feature 
and add a test case to testsuites/psxtests/psxgetattrnp01.
 
-- 
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 embedded-brains.de
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: <http://lists.rtems.org/pipermail/users/attachments/20170920/cfc13690/attachment.html>


More information about the users mailing list