Module: xenomai-3
Branch: next
Commit: 3b3421f8dab4adbee0d4830a35310b4a43ec5671
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3b3421f8dab4adbee0d4830a35310b4a43ec5671

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Jul 22 11:55:28 2015 +0200

boilerplate: provide placeholder for pthread_attr_setaffinity_np()

---

 include/boilerplate/libc.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h
index 42cc0fb..4d85ee9 100644
--- a/include/boilerplate/libc.h
+++ b/include/boilerplate/libc.h
@@ -107,10 +107,13 @@ int pthread_mutexattr_getprotocol(const 
pthread_mutexattr_t *
 #endif /* !HAVE_PTHREAD_MUTEXATTR_GETPROTOCOL */
 
 #ifndef HAVE_PTHREAD_ATTR_SETAFFINITY_NP
+#include <sched.h>
 static inline
 int pthread_attr_setaffinity_np(pthread_attr_t *attr,
                                size_t cpusetsize, const cpu_set_t *cpuset)
 {
+       if (CPU_ISSET(0, cpuset) && CPU_COUNT(cpuset) == 1)
+               return 0;
        return ENOSYS;
 }
 #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to