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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Wed Nov  4 01:34:59 2015 +0100

lib/cobalt: allow getting/setting affinity in pthread_attr_ex_t

---

 include/cobalt/pthread.h |    7 +++++++
 lib/cobalt/attr.c        |   12 ++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/include/cobalt/pthread.h b/include/cobalt/pthread.h
index 386c337..1d229de 100644
--- a/include/cobalt/pthread.h
+++ b/include/cobalt/pthread.h
@@ -164,6 +164,13 @@ int pthread_attr_getpersonality_ex(const pthread_attr_ex_t 
*attr_ex,
 
 int pthread_attr_setpersonality_ex(pthread_attr_ex_t *attr_ex,
                                   int personality);
+
+int pthread_attr_getaffinity_ex(pthread_attr_ex_t *attr_ex,
+                               size_t size, cpu_set_t *cpuset);
+
+int pthread_attr_setaffinity_ex(pthread_attr_ex_t *attr_ex,
+                               size_t size, const cpu_set_t *cpuset);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/cobalt/attr.c b/lib/cobalt/attr.c
index 586de92..657771b 100644
--- a/lib/cobalt/attr.c
+++ b/lib/cobalt/attr.c
@@ -131,6 +131,18 @@ int pthread_attr_setscope_ex(pthread_attr_ex_t *attr_ex,
        return pthread_attr_setscope(&attr_ex->std, scope);
 }
 
+int pthread_attr_getaffinity_ex(pthread_attr_ex_t *attr_ex,
+                               size_t size, cpu_set_t *cpuset)
+{
+       return pthread_attr_getaffinity_np(&attr_ex->std, size, cpuset);
+}
+
+int pthread_attr_setaffinity_ex(pthread_attr_ex_t *attr_ex,
+                               size_t size, const cpu_set_t *cpuset)
+{
+       return pthread_attr_setaffinity_np(&attr_ex->std, size, cpuset);
+}
+
 int pthread_attr_getpersonality_ex(const pthread_attr_ex_t *attr_ex,
                                   int *personality)
 {


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

Reply via email to