summaryrefslogtreecommitdiff
path: root/userland/libc/signal
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-30 20:46:36 +0100
committerAnton Kling <anton@kling.gg>2023-10-30 21:49:48 +0100
commitecf1e4c6c6efc3edeb006ff120ac60a191ddce50 (patch)
treedb5e312704d43ec8ff0a81bc87c9a1cdf6b01970 /userland/libc/signal
parentc7a07bf214ef9b3fabc15c8e70f696ede9644c2c (diff)
Kernel/LibC: Add signals and support for custom signal handlers to processes.
Diffstat (limited to 'userland/libc/signal')
-rw-r--r--userland/libc/signal/kill.c4
-rw-r--r--userland/libc/signal/sigaction.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/userland/libc/signal/kill.c b/userland/libc/signal/kill.c
new file mode 100644
index 0000000..3351baa
--- /dev/null
+++ b/userland/libc/signal/kill.c
@@ -0,0 +1,4 @@
+#include <signal.h>
+#include <syscall.h>
+
+int kill(pid_t pid, int sig) { RC_ERRNO(syscall(SYS_KILL, pid, sig, 0, 0, 0)) }
diff --git a/userland/libc/signal/sigaction.c b/userland/libc/signal/sigaction.c
new file mode 100644
index 0000000..1ff22a7
--- /dev/null
+++ b/userland/libc/signal/sigaction.c
@@ -0,0 +1,7 @@
+#include <signal.h>
+#include <syscall.h>
+
+int sigaction(int sig, const struct sigaction *act,
+ struct sigaction *oact) {
+ RC_ERRNO(syscall(SYS_SIGACTION, sig, act, oact, 0,0))
+}