fix previous commit that broke sigreturn. looks like the asm is needed.
authorRich Felker <dalias@aerifal.cx>
Mon, 14 Feb 2011 00:01:43 +0000 (19:01 -0500)
committerRich Felker <dalias@aerifal.cx>
Mon, 14 Feb 2011 00:01:43 +0000 (19:01 -0500)
src/signal/i386/restore.s [new file with mode: 0644]
src/signal/restore.c [new file with mode: 0644]
src/signal/sigaction.c

diff --git a/src/signal/i386/restore.s b/src/signal/i386/restore.s
new file mode 100644 (file)
index 0000000..e0c4ab6
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
index 9a362262174c8838f52f7bf9d7023f0aeec445ce..b1603b9f4772e8b6e30625b4d8c1ca3fa7626cf4 100644 (file)
@@ -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;
        }