diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-06 10:07:38 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-09 14:52:58 +0200 |
commit | af9115f35cfb3d0adeb3e105fd608883596f2637 (patch) | |
tree | d6638dc66e87ad1736f7675f79e7e6d116e5c463 /cpukit/posix/src/pthreadattrgetaffinitynp.c | |
parent | score: Change Timestamp_Control to sbintime_t (diff) | |
download | rtems-af9115f35cfb3d0adeb3e105fd608883596f2637.tar.bz2 |
posix: Simplify POSIX_API_Control
Return stack area via pthread_getattr_np().
Simplify
* pthread_attr_setaffinity_np(), and
* pthread_attr_getaffinity_np()
and let the scheduler do the more sophisticated error checks.
Make
* 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.
Diffstat (limited to 'cpukit/posix/src/pthreadattrgetaffinitynp.c')
-rw-r--r-- | cpukit/posix/src/pthreadattrgetaffinitynp.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/cpukit/posix/src/pthreadattrgetaffinitynp.c b/cpukit/posix/src/pthreadattrgetaffinitynp.c index 6ed50507be..b281b11e5f 100644 --- a/cpukit/posix/src/pthreadattrgetaffinitynp.c +++ b/cpukit/posix/src/pthreadattrgetaffinitynp.c @@ -24,23 +24,19 @@ #include <pthread.h> #include <errno.h> -#include <rtems/posix/pthreadimpl.h> -#include <rtems/posix/priorityimpl.h> -#include <rtems/score/threadimpl.h> - int pthread_attr_getaffinity_np( const pthread_attr_t *attr, size_t cpusetsize, cpu_set_t *cpuset ) { - if ( !cpuset ) - return EFAULT; - if ( !attr ) - return EFAULT; + if ( attr == NULL || !attr->is_initialized ) { + return EINVAL; + } - if ( cpusetsize != attr->affinitysetsize) + if ( cpuset == NULL || cpusetsize != attr->affinitysetsize ) { return EINVAL; + } CPU_COPY( attr->affinityset, cpuset ); return 0; |