From bd5969fc876a10b18613302db7087ef3c40f18e1 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 7 Mar 2024 17:28:00 -0500 Subject: lib: Add mlibc Signed-off-by: Ian Moffett --- lib/mlibc/sysdeps/lemon/generic/signals.cpp | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/mlibc/sysdeps/lemon/generic/signals.cpp (limited to 'lib/mlibc/sysdeps/lemon/generic/signals.cpp') diff --git a/lib/mlibc/sysdeps/lemon/generic/signals.cpp b/lib/mlibc/sysdeps/lemon/generic/signals.cpp new file mode 100644 index 0000000..46b4714 --- /dev/null +++ b/lib/mlibc/sysdeps/lemon/generic/signals.cpp @@ -0,0 +1,38 @@ +#include + +#include + +#include + +namespace mlibc{ + +int sys_sigprocmask(int how, const sigset_t *__restrict set, + sigset_t *__restrict retrieve){ + int ret = syscall(SYS_SIGPROCMASK, how, set, retrieve); + if(ret < 0){ + return -ret; + } + + return 0; +} + +int sys_sigaction(int signal, const struct sigaction *__restrict action, + struct sigaction *__restrict oldAction) { + int ret = syscall(SYS_SIGNAL_ACTION, signal, action, oldAction); + if(ret < 0){ + return -ret; + } + + return 0; +} + +int sys_kill(int pid, int signal){ + int ret = syscall(SYS_KILL, pid, signal); + if(ret < 0){ + return -ret; + } + + return 0; +} + +} \ No newline at end of file -- cgit v1.2.3