about summary refs log tree commit diff
path: root/src/signal/raise.c
blob: 35063c5b89c78ae37405cf299626b0fe20a38aca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <signal.h>
#include <stdint.h>
#include "syscall.h"
#include "pthread_impl.h"

int raise(int sig)
{
	int pid, tid, ret;
	sigset_t set;
	__block_app_sigs(&set);
	tid = __syscall(SYS_gettid);
	pid = __syscall(SYS_getpid);
	ret = syscall(SYS_tgkill, pid, tid, sig);
	__restore_sigs(&set);
	return ret;
}