Luna/libc/src/signal.cpp

27 lines
550 B
C++

#include <bits/errno-return.h>
#include <signal.h>
#include <sys/syscall.h>
#include <unistd.h>
extern "C" void sigreturn();
extern "C"
{
int sigaction(int signo, const struct sigaction* act, struct sigaction* oldact)
{
long rc = syscall(SYS_sigaction, signo, act, oldact, sigreturn);
__errno_return(rc, int);
}
int kill(pid_t pid, int signo)
{
long rc = syscall(SYS_kill, pid, signo);
__errno_return(rc, int);
}
int raise(int signo)
{
return kill(getpid(), signo);
}
}