summaryrefslogtreecommitdiffstats
path: root/usr/klibc/siglongjmp.c
blob: 45f4e400e00c97cfd56abb5ea5b81a53c7db1b0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * siglongjmp.c
 *
 * sigsetjmp() is a macro, by necessity (it's either that or write
 * it in assembly), but siglongjmp() is a normal function.
 */

#include <setjmp.h>
#include <signal.h>

__noreturn siglongjmp(sigjmp_buf buf, int retval)
{
	if (buf->__sigs_saved)
		sigprocmask(SIG_SETMASK, &buf->__sigs, NULL);
	longjmp(buf->__jmpbuf, retval);
}