summaryrefslogtreecommitdiff
path: root/05/musl-0.6.0/src/signal/siglongjmp.c
blob: 33ac30eaba05597efd6509843393a7e4800ef4fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <setjmp.h>
#include <signal.h>
#include <stdlib.h>

void siglongjmp(sigjmp_buf buf, int ret)
{
	long *flag = buf + sizeof(jmp_buf)/sizeof(long);
	sigset_t *mask = (void *)(flag + 1);
	if (*flag)
		sigprocmask (SIG_SETMASK, mask, NULL);
	longjmp((void *)buf, ret);
}