mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-08 07:42:09 +03:00
fix previous commit that broke sigreturn. looks like the asm is needed.
This commit is contained in:
parent
6027201e5a
commit
dc3776d445
15
src/signal/i386/restore.s
Normal file
15
src/signal/i386/restore.s
Normal file
@ -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
|
||||||
|
|
0
src/signal/restore.c
Normal file
0
src/signal/restore.c
Normal file
@ -4,10 +4,7 @@
|
|||||||
#include "syscall.h"
|
#include "syscall.h"
|
||||||
#include "pthread_impl.h"
|
#include "pthread_impl.h"
|
||||||
|
|
||||||
static void restorer()
|
void __restore(), __restore_rt();
|
||||||
{
|
|
||||||
syscall0(__NR_rt_sigreturn);
|
|
||||||
}
|
|
||||||
|
|
||||||
int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old)
|
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) {
|
if (sa) {
|
||||||
ksa.handler = sa->sa_handler;
|
ksa.handler = sa->sa_handler;
|
||||||
ksa.flags = sa->sa_flags | SA_RESTORER;
|
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;
|
ksa.mask = sa->sa_mask;
|
||||||
pksa = (long)&ksa;
|
pksa = (long)&ksa;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user