From ecf1e4c6c6efc3edeb006ff120ac60a191ddce50 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 30 Oct 2023 20:46:36 +0100 Subject: Kernel/LibC: Add signals and support for custom signal handlers to processes. --- userland/libc/signal/kill.c | 4 ++++ userland/libc/signal/sigaction.c | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 userland/libc/signal/kill.c create mode 100644 userland/libc/signal/sigaction.c (limited to 'userland/libc/signal') 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 +#include + +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 +#include + +int sigaction(int sig, const struct sigaction *act, + struct sigaction *oact) { + RC_ERRNO(syscall(SYS_SIGACTION, sig, act, oact, 0,0)) +} -- cgit v1.2.3