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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Jul  1 20:57:48 2014 +0200

boilerplate/ancillaries: add service for retrieving the per-task kernel id

---

 include/boilerplate/ancillaries.h |    2 ++
 lib/boilerplate/ancillaries.c     |    6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/include/boilerplate/ancillaries.h 
b/include/boilerplate/ancillaries.h
index 85d1142..2cb51d6 100644
--- a/include/boilerplate/ancillaries.h
+++ b/include/boilerplate/ancillaries.h
@@ -88,6 +88,8 @@ void boilerplate_init(void);
 
 int get_static_cpu_count(void);
 
+pid_t get_thread_pid(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/boilerplate/ancillaries.c b/lib/boilerplate/ancillaries.c
index 56b40ae..4e25fbb 100644
--- a/lib/boilerplate/ancillaries.c
+++ b/lib/boilerplate/ancillaries.c
@@ -16,6 +16,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 #include <sys/types.h>
+#include <sys/syscall.h>
 #include <stdio.h>
 #include <time.h>
 #include <stdlib.h>
@@ -268,6 +269,11 @@ int get_static_cpu_count(void)
        return count;
 }
 
+pid_t get_thread_pid(void)
+{
+       return syscall(__NR_gettid);
+}
+
 static void __boilerplate_init(void)
 {
        __RT(clock_gettime(CLOCK_MONOTONIC, &__init_date));


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

Reply via email to