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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue May  6 18:29:36 2014 +0200

lib/cobalt: expose sigqueue() service

---

 doc/asciidoc/MIGRATION.adoc |   12 ++++++++----
 include/cobalt/signal.h     |    3 +++
 lib/cobalt/cobalt.wrappers  |    1 +
 lib/cobalt/signal.c         |   14 ++++++++++++++
 4 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/doc/asciidoc/MIGRATION.adoc b/doc/asciidoc/MIGRATION.adoc
index b7a5787..3eb5dc9 100644
--- a/doc/asciidoc/MIGRATION.adoc
+++ b/doc/asciidoc/MIGRATION.adoc
@@ -501,16 +501,20 @@ condition variable).
 - Support for Xenomai real-time signals is available.
 
 [normal]
-Cobalt replacements for +sigwait()+, +sigwaitinfo()+, +sigtimedwait()+
-and +kill()+ are available. +pthread_kill()+ was changed to send
-thread-directed Xenomai signals (instead of regular Linux signals).
+Cobalt replacements for +sigwait()+, +sigwaitinfo()+,
++sigtimedwait()+, +sigqueue()+ and +kill()+ are
+available. +pthread_kill()+ was changed to send thread-directed
+Xenomai signals (instead of regular Linux signals).
 
 [normal]
 Cobalt-based signals are stricly real-time. Both the sender and
 receiver sides work exclusively from the primary domain. However, only
 synchronous handling is available, with a thread waiting explicitly
 for a set of signals, using one of the +sigwait+ calls. There is no
-support for asynchronous delivery of signals to handlers.
+support for asynchronous delivery of signals to handlers. For this
+reason, there is no provision in the Cobalt API for masking signals,
+as Cobalt signals are implicitly blocked for a thread until the latter
+invokes one of the +sigwait+ calls.
 
 [normal]
 Signals from SIGRTMIN..SIGRTMAX are queued.
diff --git a/include/cobalt/signal.h b/include/cobalt/signal.h
index 02e91c6..febc752 100644
--- a/include/cobalt/signal.h
+++ b/include/cobalt/signal.h
@@ -47,6 +47,9 @@ COBALT_DECL(int, sigtimedwait(const sigset_t *set, siginfo_t 
*si,
 
 COBALT_DECL(int, kill(pid_t pid, int sig));
 
+COBALT_DECL(int, sigqueue(pid_t pid, int sig,
+                         const union sigval value));
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/cobalt/cobalt.wrappers b/lib/cobalt/cobalt.wrappers
index ef5f8ba..ecbfe94 100644
--- a/lib/cobalt/cobalt.wrappers
+++ b/lib/cobalt/cobalt.wrappers
@@ -111,5 +111,6 @@
 --wrap sigwaitinfo
 --wrap sigtimedwait
 --wrap sigpending
+--wrap sigqueue
 --wrap kill
 --wrap sleep
diff --git a/lib/cobalt/signal.c b/lib/cobalt/signal.c
index 8ff9090..98422e1 100644
--- a/lib/cobalt/signal.c
+++ b/lib/cobalt/signal.c
@@ -94,3 +94,17 @@ COBALT_IMPL(int, kill, (pid_t pid, int sig))
 
        return 0;
 }
+
+COBALT_IMPL(int, sigqueue, (pid_t pid, int sig, const union sigval value))
+{
+       int ret;
+
+       ret = XENOMAI_SKINCALL3(__cobalt_muxid,
+                               sc_cobalt_sigqueue, pid, sig, &value);
+       if (ret) {
+               errno = -ret;
+               return -1;
+       }
+
+       return 0;
+}


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

Reply via email to