summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386
diff options
context:
space:
mode:
authorDmitry Chestnykh <dm.chestnykh@gmail.com>2024-04-20 13:33:52 +0300
committerWaldemar Brodkorb <wbx@openadk.org>2024-04-20 14:20:31 +0200
commit7e528892baee2234b8db434bc08c82f83c4b928c (patch)
tree6ddda3834115a7107be6cc3133a2999b671487b3 /libc/sysdeps/linux/i386
parent72b01dd20f9cea273809e3437b4aba849ae658af (diff)
x86: Fix __libc_sigaction implementation.
For x86 we have to copy only mask, handler and flags. We haven't set SA_RESTORER bit in sa_flags anyway. This patch fixes multiple test failures on x86. Also we have to build uClibc with FP for x86 because without FP NPTL and libgcc code cannot properly unwind the stack during asynchronous cancellation of system calls. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/i386')
-rw-r--r--libc/sysdeps/linux/i386/sigaction.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/i386/sigaction.c b/libc/sysdeps/linux/i386/sigaction.c
index cf6daa787..515ef99f2 100644
--- a/libc/sysdeps/linux/i386/sigaction.c
+++ b/libc/sysdeps/linux/i386/sigaction.c
@@ -31,15 +31,16 @@
extern void restore_rt(void) __asm__ ("__restore_rt") attribute_hidden;
extern void restore(void) __asm__ ("__restore") attribute_hidden;
-/* If ACT is not NULL, change the action for SIG to *ACT.
+/* If ACT is not NULL, change mask, handler and flags for SIG to ACT's
If OACT is not NULL, put the old action for SIG in *OACT. */
int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
{
struct sigaction kact;
if (act) {
- memcpy(&kact, act, sizeof(kact));
- kact.sa_flags |= SA_RESTORER;
+ memcpy(&kact.sa_mask, &act->sa_mask, sizeof(sigset_t));
+ kact.sa_handler = act->sa_handler;
+ kact.sa_flags = act->sa_flags;
kact.sa_restorer = (act->sa_flags & SA_SIGINFO) ? &restore_rt : &restore;
act = &kact;
}