-
- Downloads
libc: implement sigsetjmp(), siglongjmp()
This patch implements the sigsetjmp()/siglongjmp() functions. Fixes #241.
sigsetjmp() and siglongjmp() are similar to setjmp() and longjmp(), except
that they also save and restore the signals mask. Signals are hardly useful
in OSv, so we don't necessarily need this signal mask feature, but we still
want to implement these functions, if only so that applications which use
them by default could run (see issue #241).
Most of the code in this patch is from Musl 1.0.0, with a few small
modifications - namely, call our sigprocmask() function instead a Linux
syscall. Note I copied the x64 version of sigsetjmp.s only. Musl also
has this file for ARM and other architectures. Interestingly we already
had in our source tree, but didn't use, block.c, and this patch starts
to use it.
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
Showing
- include/api/setjmp.h 6 additions, 7 deletionsinclude/api/setjmp.h
- include/api/x64/bits/setjmp.h 1 addition, 1 deletioninclude/api/x64/bits/setjmp.h
- libc/build.mk 3 additions, 0 deletionslibc/build.mk
- libc/signal/block.c 3 additions, 4 deletionslibc/signal/block.c
- libc/signal/siglongjmp.c 9 additions, 0 deletionslibc/signal/siglongjmp.c
- libc/signal/sigsetjmp.s 14 additions, 0 deletionslibc/signal/sigsetjmp.s
libc/signal/siglongjmp.c
0 → 100644
libc/signal/sigsetjmp.s
0 → 100644
Please register or sign in to comment