aboutsummaryrefslogtreecommitdiff
path: root/src/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/system.c')
-rw-r--r--src/system.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/system.c b/src/system.c
index cff4f54..9a9a80e 100644
--- a/src/system.c
+++ b/src/system.c
@@ -5,6 +5,7 @@
#include "stdio.h"
#include "unistd.h"
#include "string.h"
+#include "signal.h"
#include "types.h"
@@ -20,7 +21,7 @@ err e33_ioctl( Size fd, unsigned long req, void *arg )
return ret;
}
-boolean strcomp( String s1, String s2 )
+boolean e33_strcmp( String s1, String s2 )
{
while( (*s1 != '\0') && (*s2 != '\0') )
{
@@ -32,3 +33,18 @@ boolean strcomp( String s1, String s2 )
return E33_TRUE;
}
+err e33_has_signal(Size signo)
+{
+ struct sigaction sact = {0};
+ sigaction(signo, 0, &sact);
+ return sact.sa_handler != 0;
+}
+
+err e33_set_signal(Size signo, void(*sig_handler)(int))
+{
+ struct sigaction sact = {0};
+ sact.sa_handler = sig_handler;
+ sigemptyset(&sact.sa_mask);
+ sact.sa_flags = SA_RESTART;
+ return sigaction(signo, &sact, NULL);
+}