Use sigprocmask rather than sigblock/sigsetmask.
No effect right now, because sigprocmask on LP32 also only touches
the non-RT signals, but this makes it easier to switch to __rt_sigprocmask.
Bug: http://b/72460436
Test: ran tests
Change-Id: I693f0ea36701e9ab5d10e6aefb26387ba45a6064
diff --git a/libc/arch-arm/bionic/setjmp.S b/libc/arch-arm/bionic/setjmp.S
index b814124..c10bd3e 100644
--- a/libc/arch-arm/bionic/setjmp.S
+++ b/libc/arch-arm/bionic/setjmp.S
@@ -218,8 +218,10 @@
beq 1f
// Restore the signal mask.
- ldr r0, [r0, #(_JB_SIGMASK * 4)]
- bl sigsetmask
+ mov r2, #0
+ add r1, r0, #(_JB_SIGMASK * 4)
+ mov r0, #2 // SIG_SETMASK
+ bl sigprocmask
1:
ldmfd sp!, {r0, r1, lr}
diff --git a/libc/arch-x86/bionic/setjmp.S b/libc/arch-x86/bionic/setjmp.S
index 6e6c365..f9f7cd7 100644
--- a/libc/arch-x86/bionic/setjmp.S
+++ b/libc/arch-x86/bionic/setjmp.S
@@ -110,16 +110,17 @@
testl $1,%eax
jz 1f
- // Get the current signal mask.
+ // Save the current signal mask.
+ pushl %ecx
PIC_PROLOGUE
- pushl $0
- call PIC_PLT(sigblock)
- addl $4,%esp
+ leal (_JB_SIGMASK * 4)(%ecx),%eax
+ pushl %eax
+ pushl $0 // NULL
+ pushl $2 // SIG_SETMASK
+ call PIC_PLT(sigprocmask)
+ addl $12,%esp
PIC_EPILOGUE
-
- // Save the signal mask.
- movl 4(%esp),%ecx
- movl %eax,(_JB_SIGMASK * 4)(%ecx)
+ popl %ecx
1:
// Fetch the setjmp cookie and clear the signal flag bit.
@@ -159,10 +160,13 @@
jz 1f
// Restore the signal mask.
+ leal (_JB_SIGMASK * 4)(%edx),%eax
PIC_PROLOGUE
- pushl (_JB_SIGMASK * 4)(%edx)
- call PIC_PLT(sigsetmask)
- addl $4,%esp
+ pushl $0 // NULL
+ pushl %eax
+ pushl $2 // SIG_SETMASK
+ call PIC_PLT(sigprocmask)
+ addl $12,%esp
PIC_EPILOGUE
1: