From 326cedcca7050ec0b143ff3d2ad94839f77ab22e Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 1 Jul 2024 16:21:43 +0200 Subject: LibC: Change how kill() works --- userland/libc/signal/kill.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'userland/libc/signal/kill.c') diff --git a/userland/libc/signal/kill.c b/userland/libc/signal/kill.c index c5ed62b..c8a368f 100644 --- a/userland/libc/signal/kill.c +++ b/userland/libc/signal/kill.c @@ -1,6 +1,15 @@ +#include +#include #include #include -int kill(int fd, int sig) { +int kill_fd(int fd, int sig) { RC_ERRNO(syscall(SYS_KILL, fd, sig, 0, 0, 0)) } + +int kill(int pid, int sig) { + int fd = open_process(pid); + int rc = kill_fd(fd, sig); + close(fd); + return rc; +} -- cgit v1.2.3