musl/src/signal/raise.c

18 lines
410 B
C
Raw Normal View History

2011-02-12 00:22:29 -05:00
#include <signal.h>
2011-03-09 19:42:06 -05:00
#include <errno.h>
#include <stdint.h>
2011-02-12 00:22:29 -05:00
#include "syscall.h"
#include "pthread_impl.h"
2011-02-12 00:22:29 -05:00
int raise(int sig)
{
2011-03-09 19:42:06 -05:00
int pid, tid, ret;
sigset_t set;
__syscall(SYS_rt_sigprocmask, SIG_BLOCK, SIGALL_SET, &set, _NSIG/8);
tid = syscall(SYS_gettid);
pid = syscall(SYS_getpid);
ret = syscall(SYS_tgkill, pid, tid, sig);
__syscall(SYS_rt_sigprocmask, SIG_SETMASK, &set, 0, _NSIG/8);
2011-03-09 19:42:06 -05:00
return ret;
2011-02-12 00:22:29 -05:00
}