include cleanups: remove unused headers and add feature test macros
[musl] / src / signal / sigsetjmp.c
1 #include <setjmp.h>
2 #include <signal.h>
3
4 /* !!! This function will not work unless the compiler performs
5  * tail call optimization. Machine-specific asm versions should
6  * be created instead even though the workaround (tail call)
7  * is entirely non-machine-specific... */
8
9 int sigsetjmp(sigjmp_buf buf, int save)
10 {
11         if ((buf->__fl = save))
12                 pthread_sigmask(SIG_SETMASK, 0, (sigset_t *)buf->__ss);
13         return setjmp(buf);
14 }