diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-04-26 10:34:11 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-04-27 19:40:12 +0200 |
commit | 14526992418137af1b64d8be02a30fd91406195a (patch) | |
tree | 5286c85142b405d3e2facdab3830d233e1322df6 /cpukit/posix/src/pthreadgetattrnp.c | |
parent | rtems: Constify timer fire when directives (diff) | |
download | rtems-14526992418137af1b64d8be02a30fd91406195a.tar.bz2 |
Return status code for _Scheduler_Get_affinity()
This avoids having conditional statements to get the API-specific status
code.
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/pthreadgetattrnp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cpukit/posix/src/pthreadgetattrnp.c b/cpukit/posix/src/pthreadgetattrnp.c index eae29d1de7..5572fb98a5 100644 --- a/cpukit/posix/src/pthreadgetattrnp.c +++ b/cpukit/posix/src/pthreadgetattrnp.c @@ -26,6 +26,7 @@ #include <string.h> #include <rtems/posix/pthreadimpl.h> +#include <rtems/posix/posixapi.h> #include <rtems/posix/pthreadattrimpl.h> #include <rtems/posix/priorityimpl.h> #include <rtems/score/schedulerimpl.h> @@ -41,7 +42,7 @@ int pthread_getattr_np( Thread_CPU_budget_algorithms budget_algorithm; const Scheduler_Control *scheduler; Priority_Control priority; - bool ok; + Status_Control status; if ( attr == NULL ) { return EINVAL; @@ -82,7 +83,7 @@ int pthread_getattr_np( attr->affinityset = &attr->affinitysetpreallocated; attr->affinitysetsize = sizeof( attr->affinitysetpreallocated ); - ok = _Scheduler_Get_affinity( + status = _Scheduler_Get_affinity( the_thread, attr->affinitysetsize, attr->affinityset @@ -102,5 +103,5 @@ int pthread_getattr_np( attr->schedpolicy = _POSIX_Thread_Translate_to_sched_policy( budget_algorithm ); - return ok ? 0 : EINVAL; + return _POSIX_Get_error( status ); } |