diff options
Diffstat (limited to 'cpukit/posix/src/pthreadgetattrnp.c')
-rw-r--r-- | cpukit/posix/src/pthreadgetattrnp.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/cpukit/posix/src/pthreadgetattrnp.c b/cpukit/posix/src/pthreadgetattrnp.c index d815fc8c53..bebf35e4d6 100644 --- a/cpukit/posix/src/pthreadgetattrnp.c +++ b/cpukit/posix/src/pthreadgetattrnp.c @@ -24,6 +24,8 @@ #include <string.h> #include <rtems/posix/pthreadimpl.h> +#include <rtems/posix/pthreadattrimpl.h> +#include <rtems/posix/priorityimpl.h> #include <rtems/score/schedulerimpl.h> #include <rtems/score/threadimpl.h> @@ -32,10 +34,11 @@ int pthread_getattr_np( pthread_attr_t *attr ) { - Thread_Control *the_thread; - ISR_lock_Context lock_context; - POSIX_API_Control *api; - bool ok; + Thread_Control *the_thread; + ISR_lock_Context lock_context; + POSIX_API_Control *api; + const Scheduler_Control *scheduler; + bool ok; if ( attr == NULL ) { return EINVAL; @@ -65,7 +68,18 @@ int pthread_getattr_np( } attr->schedpolicy = api->schedpolicy; - attr->schedparam = api->schedparam; + + scheduler = _Thread_Scheduler_get_home( the_thread ); + attr->schedparam.sched_priority = _POSIX_Priority_From_core( + scheduler, + _Thread_Get_priority( the_thread ) + ); + _POSIX_Threads_Get_sched_param_sporadic( + the_thread, + api, + scheduler, + &attr->schedparam + ); attr->cputime_clock_allowed = 1; if ( _Thread_Is_joinable( the_thread ) ) { |