#3145 closed defect (fixed)

pthread_getattr_np does not work

Reported by: ye0me0ge0tt Owned by: joel.sherrill@…
Priority: highest Milestone:
Component: score Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:


I can not get attributes of thread via this function.

The code shows below (sorry that I can not attack a file behind this)

#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);


The return value of pthread_getattr_np is 0 which means that this function runs well, but the elements of attr structure are either 0(like stackaddr and stacksize) or 1(like is_initialized).

Change History (2)

comment:1 Changed on 10/10/17 at 05:43:49 by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: newclosed

In af9115f3/rtems:

posix: Simplify POSIX_API_Control

Return stack area via pthread_getattr_np().


  • pthread_attr_setaffinity_np(), and
  • pthread_attr_getaffinity_np()

and let the scheduler do the more sophisticated error checks.


  • pthread_setaffinity_np(),
  • pthread_getaffinity_np(),
  • pthread_attr_setaffinity_np(), and
  • pthread_attr_getaffinity_np()

available in all configurations.

Update #2514.
Close #3145.
Close #3168.

comment:2 Changed on 11/02/17 at 10:25:59 by Sebastian Huber <sebastian.huber@…>

In 81fd79d/rtems:

smppsxaffinity02: Fix thread attribute usage

The pthread_getattr_np() returns now the stack address and size. Do not
use this stack for the new threads.

Update #2514.
Update #3145.
Update #3168.

Note: See TracTickets for help on using tickets.