diff options
author | Jennifer Averett <jennifer.averett@oarcorp.com> | 2014-03-19 15:21:15 -0500 |
---|---|---|
committer | Jennifer Averett <jennifer.averett@oarcorp.com> | 2014-04-03 10:48:57 -0500 |
commit | e045fb6c60a495aafd2ced0fd756862a66e98ce3 (patch) | |
tree | a6773e1a8483e0ed1ad823024ce6bae25232fb4d /cpukit/posix/src/pthreadgetaffinitynp.c | |
parent | posix: Modified pthread init to use cpuset default. (diff) | |
download | rtems-e045fb6c60a495aafd2ced0fd756862a66e98ce3.tar.bz2 |
posix: Move affinity from thread to scheduler.
Diffstat (limited to 'cpukit/posix/src/pthreadgetaffinitynp.c')
-rw-r--r-- | cpukit/posix/src/pthreadgetaffinitynp.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cpukit/posix/src/pthreadgetaffinitynp.c b/cpukit/posix/src/pthreadgetaffinitynp.c index 082e41adbd..497236f60f 100644 --- a/cpukit/posix/src/pthreadgetaffinitynp.c +++ b/cpukit/posix/src/pthreadgetaffinitynp.c @@ -28,6 +28,7 @@ #include <rtems/posix/pthreadimpl.h> #include <rtems/posix/priorityimpl.h> #include <rtems/score/threadimpl.h> +#include <rtems/score/schedulerimpl.h> int pthread_getaffinity_np( const pthread_t id, @@ -37,7 +38,7 @@ int pthread_getaffinity_np( { Objects_Locations location; Thread_Control *the_thread; - int error; + bool ok; if ( !cpuset ) return EFAULT; @@ -46,14 +47,11 @@ int pthread_getaffinity_np( switch ( location ) { case OBJECTS_LOCAL: - error = 0; - if ( cpusetsize != the_thread->affinity.setsize ) - error = EINVAL; - else - CPU_COPY( cpuset, the_thread->affinity.set ); - + ok = _Scheduler_Get_affinity( the_thread, cpusetsize, cpuset ); _Objects_Put( &the_thread->Object ); - return error; + if (!ok) + return EINVAL; + return 0; break; #if defined(RTEMS_MULTIPROCESSING) |