summaryrefslogtreecommitdiff
path: root/src/signal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-08-09 22:52:13 -0400
committerRich Felker <dalias@aerifal.cx>2012-08-09 22:52:13 -0400
commit2f437040e7911d9bef239588ea7ed6f4b9102922 (patch)
treecfb4950352818b7a3ed2f5be9d9425bbb0b7cd3a /src/signal
parent83b42d94bd1009da6a95052d9ef0edeb1c73c8e4 (diff)
downloadmusl-2f437040e7911d9bef239588ea7ed6f4b9102922.tar.gz
fix (hopefully) all hard-coded 8's for kernel sigset_t size
some minor changes to how hard-coded sets for thread-related purposes are handled were also needed, since the old object sizes were not necessarily sufficient. things have gotten a bit ugly in this area, and i think a cleanup is in order at some point, but for now the goal is just to get the code working on all supported archs including mips, which was badly broken by linux rejecting syscalls with the wrong sigset_t size.
Diffstat (limited to 'src/signal')
-rw-r--r--src/signal/raise.c5
-rw-r--r--src/signal/siglongjmp.c4
-rw-r--r--src/signal/sigpending.c2
-rw-r--r--src/signal/sigsuspend.c2
-rw-r--r--src/signal/sigtimedwait.c3
5 files changed, 9 insertions, 7 deletions
diff --git a/src/signal/raise.c b/src/signal/raise.c
index 71e0505b..c0814fad 100644
--- a/src/signal/raise.c
+++ b/src/signal/raise.c
@@ -2,15 +2,16 @@
#include <errno.h>
#include <stdint.h>
#include "syscall.h"
+#include "pthread_impl.h"
int raise(int sig)
{
int pid, tid, ret;
sigset_t set;
- __syscall(SYS_rt_sigprocmask, SIG_BLOCK, (uint64_t[]){-1}, &set, 8);
+ __syscall(SYS_rt_sigprocmask, SIG_BLOCK, SIGALL_SET, &set, __SYSCALL_SSLEN);
tid = syscall(SYS_gettid);
pid = syscall(SYS_getpid);
ret = syscall(SYS_tgkill, pid, tid, sig);
- __syscall(SYS_rt_sigprocmask, SIG_SETMASK, &set, 0, 8);
+ __syscall(SYS_rt_sigprocmask, SIG_SETMASK, &set, 0, __SYSCALL_SSLEN);
return ret;
}
diff --git a/src/signal/siglongjmp.c b/src/signal/siglongjmp.c
index 9b4a5398..e9a61314 100644
--- a/src/signal/siglongjmp.c
+++ b/src/signal/siglongjmp.c
@@ -5,7 +5,7 @@
void siglongjmp(sigjmp_buf buf, int ret)
{
- if (buf->__fl)
- __syscall(SYS_rt_sigprocmask, SIG_SETMASK, buf->__ss, 0, 8);
+ if (buf->__fl) __syscall(SYS_rt_sigprocmask, SIG_SETMASK,
+ buf->__ss, 0, __SYSCALL_SSLEN);
longjmp(buf->__jb, ret);
}
diff --git a/src/signal/sigpending.c b/src/signal/sigpending.c
index f6b8972e..46ce3036 100644
--- a/src/signal/sigpending.c
+++ b/src/signal/sigpending.c
@@ -3,5 +3,5 @@
int sigpending(sigset_t *set)
{
- return syscall(SYS_rt_sigpending, set, 8);
+ return syscall(SYS_rt_sigpending, set, __SYSCALL_SSLEN);
}
diff --git a/src/signal/sigsuspend.c b/src/signal/sigsuspend.c
index cd3a7b59..bdfaeee0 100644
--- a/src/signal/sigsuspend.c
+++ b/src/signal/sigsuspend.c
@@ -4,5 +4,5 @@
int sigsuspend(const sigset_t *mask)
{
- return syscall_cp(SYS_rt_sigsuspend, mask, 8);
+ return syscall_cp(SYS_rt_sigsuspend, mask, __SYSCALL_SSLEN);
}
diff --git a/src/signal/sigtimedwait.c b/src/signal/sigtimedwait.c
index 7eea58ab..f62db2f3 100644
--- a/src/signal/sigtimedwait.c
+++ b/src/signal/sigtimedwait.c
@@ -6,7 +6,8 @@
int sigtimedwait(const sigset_t *mask, siginfo_t *si, const struct timespec *timeout)
{
int ret;
- do ret = syscall_cp(SYS_rt_sigtimedwait, mask, si, timeout, 8);
+ do ret = syscall_cp(SYS_rt_sigtimedwait, mask,
+ si, timeout, __SYSCALL_SSLEN);
while (ret<0 && errno==EINTR);
return ret;
}