summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-26 23:21:32 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:43 +0200
commitd60ef5b6d8b6c8fb1650e351028aa2fbd41488e8 (patch)
treee671c04863241b8c4d1afd311b8255e93b476e6f /libc/sysdeps/linux/common
parent9d101732ad0609f2f19ef20062a00cd26b01d859 (diff)
sigqueue.c: rewrite a bit
Use sizeof(info) instead of sizeof(siginfo_t). stubs.c: add sigqueue stub. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/sigqueue.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/libc/sysdeps/linux/common/sigqueue.c b/libc/sysdeps/linux/common/sigqueue.c
index c40753948..8c8b0dbf0 100644
--- a/libc/sysdeps/linux/common/sigqueue.c
+++ b/libc/sysdeps/linux/common/sigqueue.c
@@ -16,16 +16,12 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-#include <string.h>
-
#include <sys/syscall.h>
-#if defined __USE_POSIX199309
-
-#ifdef __NR_rt_sigqueueinfo
+#if defined __NR_rt_sigqueueinfo && defined __USE_POSIX199309
+# include <signal.h>
+# include <unistd.h>
+# include <string.h>
# define __NR___syscall_rt_sigqueueinfo __NR_rt_sigqueueinfo
static __always_inline _syscall3(int, __syscall_rt_sigqueueinfo, pid_t, pid, int, sig, void*, value)
@@ -33,20 +29,19 @@ static __always_inline _syscall3(int, __syscall_rt_sigqueueinfo, pid_t, pid, int
/* Return any pending signal or wait for one for the given time. */
int sigqueue (pid_t pid, int sig, const union sigval val)
{
- siginfo_t info;
-
- /* First, clear the siginfo_t structure, so that we don't pass our
- stack content to other tasks. */
- memset (&info, 0, sizeof (siginfo_t));
- /* We must pass the information about the data in a siginfo_t value. */
- info.si_signo = sig;
- info.si_code = SI_QUEUE;
- info.si_pid = getpid ();
- info.si_uid = getuid ();
- info.si_value = val;
-
- return __syscall_rt_sigqueueinfo(pid, sig, &info);
+ siginfo_t info;
+
+ /* First, clear the siginfo_t structure, so that we don't pass our
+ stack content to other tasks. */
+ memset(&info, 0, sizeof(info));
+ /* We must pass the information about the data in a siginfo_t value. */
+ info.si_signo = sig;
+ info.si_code = SI_QUEUE;
+ info.si_pid = getpid ();
+ info.si_uid = getuid ();
+ info.si_value = val;
+
+ return __syscall_rt_sigqueueinfo(pid, sig, &info);
}
#endif
-#endif