summaryrefslogtreecommitdiff
path: root/src/signal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-13 19:01:43 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-13 19:01:43 -0500
commitdc3776d445957cd3ea4a682db518701b93d34292 (patch)
tree3ca4f09e322d51377fa8319268bd534599002233 /src/signal
parent6027201e5a7c810b3073c85f7373aae84b303ba3 (diff)
downloadmusl-dc3776d445957cd3ea4a682db518701b93d34292.tar.gz
musl-dc3776d445957cd3ea4a682db518701b93d34292.tar.bz2
musl-dc3776d445957cd3ea4a682db518701b93d34292.tar.xz
musl-dc3776d445957cd3ea4a682db518701b93d34292.zip
fix previous commit that broke sigreturn. looks like the asm is needed.
Diffstat (limited to 'src/signal')
-rw-r--r--src/signal/i386/restore.s15
-rw-r--r--src/signal/restore.c0
-rw-r--r--src/signal/sigaction.c7
3 files changed, 17 insertions, 5 deletions
diff --git a/src/signal/i386/restore.s b/src/signal/i386/restore.s
new file mode 100644
index 00000000..e0c4ab66
--- /dev/null
+++ b/src/signal/i386/restore.s
@@ -0,0 +1,15 @@
+.global __restore
+.type __restore,%function
+__restore:
+ popl %eax
+ movl $119, %eax
+ int $0x80
+.size __restore,.-__restore
+
+.global __restore_rt
+.type __restore_rt,%function
+__restore_rt:
+ movl $173, %eax
+ int $0x80
+.size __restore_rt,.-__restore_rt
+
diff --git a/src/signal/restore.c b/src/signal/restore.c
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/signal/restore.c
diff --git a/src/signal/sigaction.c b/src/signal/sigaction.c
index 9a362262..b1603b9f 100644
--- a/src/signal/sigaction.c
+++ b/src/signal/sigaction.c
@@ -4,10 +4,7 @@
#include "syscall.h"
#include "pthread_impl.h"
-static void restorer()
-{
- syscall0(__NR_rt_sigreturn);
-}
+void __restore(), __restore_rt();
int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old)
{
@@ -21,7 +18,7 @@ int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old)
if (sa) {
ksa.handler = sa->sa_handler;
ksa.flags = sa->sa_flags | SA_RESTORER;
- ksa.restorer = restorer;
+ ksa.restorer = (sa->sa_flags & SA_SIGINFO) ? __restore_rt : __restore;
ksa.mask = sa->sa_mask;
pksa = (long)&ksa;
}