mirror of
https://github.com/fluencelabs/musl
synced 2025-05-14 00:01:35 +00:00
13 lines
275 B
C
13 lines
275 B
C
|
#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);
|
||
|
}
|