1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

hermit/syscall: provide syscall interface for signals

This commit is contained in:
daniel-k 2016-08-25 17:15:52 +02:00
parent 56349176da
commit 74a56254d6
2 changed files with 18 additions and 0 deletions

View file

@ -57,6 +57,8 @@ extern "C" {
struct sem;
typedef struct sem sem_t;
typedef void (*signal_handler_t)(int);
/*
* HermitCore is a libOS.
* => classical system calls are realized as normal function
@ -88,6 +90,8 @@ int sys_rcce_init(int session_id);
size_t sys_rcce_malloc(int session_id, int ue);
int sys_rcce_fini(int session_id);
void sys_yield(void);
int sys_kill(tid_t dest, int signum);
int sys_signal(signal_handler_t handler);
#define __NR_exit 0
#define __NR_write 1

View file

@ -35,6 +35,7 @@
#include <hermit/time.h>
#include <hermit/rcce.h>
#include <hermit/memory.h>
#include <hermit/signal.h>
#include <sys/uio.h>
#include <sys/poll.h>
@ -630,6 +631,19 @@ void sys_yield(void)
#endif
}
int sys_kill(tid_t dest, int signum)
{
if(signum < 0) {
return -EINVAL;
}
return hermit_kill(dest, signum);
}
int sys_signal(signal_handler_t handler)
{
return hermit_signal(handler);
}
static int default_handler(void)
{
#if 1