projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix missing _BSD_SOURCE support in bits/*.h
[musl]
/
src
/
signal
/
sigaction.c
diff --git
a/src/signal/sigaction.c
b/src/signal/sigaction.c
index
4acd173
..
5bc9383
100644
(file)
--- a/
src/signal/sigaction.c
+++ b/
src/signal/sigaction.c
@@
-3,11
+3,12
@@
#include <errno.h>
#include "syscall.h"
#include "pthread_impl.h"
#include <errno.h>
#include "syscall.h"
#include "pthread_impl.h"
+#include "libc.h"
-static void restorer()
-{
- syscall0(__NR_rt_sigreturn);
-}
+void __restore(), __restore_rt();
+
+static pthread_t dummy(void) { return 0; }
+weak_alias(dummy, __pthread_self_def);
int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old)
{
int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old)
{
@@
-20,13
+21,14
@@
int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old)
long pksa=0, pkold=0;
if (sa) {
ksa.handler = sa->sa_handler;
long pksa=0, pkold=0;
if (sa) {
ksa.handler = sa->sa_handler;
- ksa.flags = sa->sa_flags;
- ksa.restorer =
restorer
;
+ ksa.flags = sa->sa_flags
| SA_RESTORER
;
+ ksa.restorer =
(sa->sa_flags & SA_SIGINFO) ? __restore_rt : __restore
;
ksa.mask = sa->sa_mask;
pksa = (long)&ksa;
}
if (old) pkold = (long)&kold;
ksa.mask = sa->sa_mask;
pksa = (long)&ksa;
}
if (old) pkold = (long)&kold;
- if (syscall4(__NR_rt_sigaction, sig, pksa, pkold, 8))
+ __pthread_self_def();
+ if (syscall(SYS_rt_sigaction, sig, pksa, pkold, 8))
return -1;
if (old) {
old->sa_handler = kold.handler;
return -1;
if (old) {
old->sa_handler = kold.handler;
@@
-38,7
+40,7
@@
int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old)
int __sigaction(int sig, const struct sigaction *sa, struct sigaction *old)
{
int __sigaction(int sig, const struct sigaction *sa, struct sigaction *old)
{
- if (sig
== SIGCANCEL || sig == SIGSYSCALL
) {
+ if (sig
-32U < 3
) {
errno = EINVAL;
return -1;
}
errno = EINVAL;
return -1;
}