Module: xenomai-gch
Branch: for-forge
Commit: 8a92bd3c3a123a019cfd122169a36431d5de9470
URL:    
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=8a92bd3c3a123a019cfd122169a36431d5de9470

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Fri Dec 27 00:06:36 2013 +0100

cobalt: wrap the glibc function pthread_setname_np

as an alias of pthread_set_name_np

---

 include/cobalt/pthread.h   |    2 ++
 lib/cobalt/cobalt.wrappers |    1 +
 lib/cobalt/thread.c        |    6 ++++++
 3 files changed, 9 insertions(+)

diff --git a/include/cobalt/pthread.h b/include/cobalt/pthread.h
index 84158f5..f4e654b 100644
--- a/include/cobalt/pthread.h
+++ b/include/cobalt/pthread.h
@@ -151,6 +151,8 @@ int pthread_set_mode_np(int clrmask, int setmask,
 int pthread_set_name_np(pthread_t thread,
                        const char *name);
 
+COBALT_DECL(int, pthread_setname_np(pthread_t thread, const char *name));
+
 int pthread_probe_np(pid_t tid);
 
 int pthread_create_ex(pthread_t *tid,
diff --git a/lib/cobalt/cobalt.wrappers b/lib/cobalt/cobalt.wrappers
index 519973d..dae8c11 100644
--- a/lib/cobalt/cobalt.wrappers
+++ b/lib/cobalt/cobalt.wrappers
@@ -7,6 +7,7 @@
 --wrap sched_get_priority_max
 --wrap pthread_kill
 --wrap pthread_join
+--wrap pthread_setname_np
 --wrap sem_init
 --wrap sem_destroy
 --wrap sem_post
diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c
index 190d5c7..699c85f 100644
--- a/lib/cobalt/thread.c
+++ b/lib/cobalt/thread.c
@@ -429,6 +429,12 @@ int pthread_set_name_np(pthread_t thread, const char *name)
                                  sc_cobalt_thread_set_name, thread, name);
 }
 
+COBALT_IMPL(int, pthread_setname_np, (pthread_t thread, const char *name))
+{
+       return -XENOMAI_SKINCALL2(__cobalt_muxid,
+                                 sc_cobalt_thread_set_name, thread, name);
+}
+
 int pthread_probe_np(pid_t tid)
 {
        return XENOMAI_SKINCALL1(__cobalt_muxid,


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

Reply via email to