diff options
author | pommicket <pommicket@gmail.com> | 2022-02-23 22:37:01 -0800 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-02-23 22:37:01 -0800 |
commit | c75af0c8e5fdf7792081f03ca8a01764953b19a4 (patch) | |
tree | 811fcdb32086c0b5b4a41f18031c8fcde65ca4b6 /05/musl-0.6.0/src/signal | |
parent | 9bc8a11afeed3569736b89754012e3ca22ee10f6 (diff) |
coda
Diffstat (limited to '05/musl-0.6.0/src/signal')
-rw-r--r-- | 05/musl-0.6.0/src/signal/sigaction.c | 10 | ||||
-rw-r--r-- | 05/musl-0.6.0/src/signal/sigprocmask.c | 25 |
2 files changed, 32 insertions, 3 deletions
diff --git a/05/musl-0.6.0/src/signal/sigaction.c b/05/musl-0.6.0/src/signal/sigaction.c index b1603b9..1c35e34 100644 --- a/05/musl-0.6.0/src/signal/sigaction.c +++ b/05/musl-0.6.0/src/signal/sigaction.c @@ -42,4 +42,12 @@ int __sigaction(int sig, const struct sigaction *sa, struct sigaction *old) return __libc_sigaction(sig, sa, old); } -weak_alias(__sigaction, sigaction); +int sigaction(int sig, const struct sigaction *sa, struct sigaction *old) +{ + if (sig == SIGCANCEL || sig == SIGSYSCALL) { + errno = EINVAL; + return -1; + } + return __libc_sigaction(sig, sa, old); +} + diff --git a/05/musl-0.6.0/src/signal/sigprocmask.c b/05/musl-0.6.0/src/signal/sigprocmask.c index e89f876..a8a4a87 100644 --- a/05/musl-0.6.0/src/signal/sigprocmask.c +++ b/05/musl-0.6.0/src/signal/sigprocmask.c @@ -19,5 +19,26 @@ int __sigprocmask(int how, const sigset_t *set, sigset_t *old) return __libc_sigprocmask(how, set, old); } -weak_alias(__sigprocmask, sigprocmask); -weak_alias(__sigprocmask, pthread_sigmask); +int sigprocmask(int how, const sigset_t *set, sigset_t *old) +{ + sigset_t tmp; + /* Quickly mask out bits 32 and 33 (thread control signals) */ + if (0 && how != SIG_UNBLOCK && (set->__bits[4/sizeof *set->__bits] & 3UL<<(32&8*sizeof *set->__bits-1))) { + tmp = *set; + set = &tmp; + tmp.__bits[4/sizeof *set->__bits] &= ~(3UL<<(32&8*sizeof *set->__bits-1)); + } + return __libc_sigprocmask(how, set, old); +} + +int pthread_sigmask(int how, const sigset_t *set, sigset_t *old) +{ + sigset_t tmp; + /* Quickly mask out bits 32 and 33 (thread control signals) */ + if (0 && how != SIG_UNBLOCK && (set->__bits[4/sizeof *set->__bits] & 3UL<<(32&8*sizeof *set->__bits-1))) { + tmp = *set; + set = &tmp; + tmp.__bits[4/sizeof *set->__bits] &= ~(3UL<<(32&8*sizeof *set->__bits-1)); + } + return __libc_sigprocmask(how, set, old); +} |