summaryrefslogblamecommitdiff
path: root/src/signal/raise.c
blob: c0814fad0ddfc886c00925aa81e0a7e9ec2a2098 (plain) (tree)
1
2
3
4
5
6
7
8
9
                   
                  
                   
                    
                         


                  
                          
                     
                                                                                    


                                                 
                                                                             
                   
 
#include <signal.h>
#include <errno.h>
#include <stdint.h>
#include "syscall.h"
#include "pthread_impl.h"

int raise(int sig)
{
	int pid, tid, ret;
	sigset_t set;
	__syscall(SYS_rt_sigprocmask, SIG_BLOCK, SIGALL_SET, &set, __SYSCALL_SSLEN);
	tid = syscall(SYS_gettid);
	pid = syscall(SYS_getpid);
	ret = syscall(SYS_tgkill, pid, tid, sig);
	__syscall(SYS_rt_sigprocmask, SIG_SETMASK, &set, 0, __SYSCALL_SSLEN);
	return ret;
}