diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index ad15a2437c..a3d4c1bf3d 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -164,4 +164,11 @@ ErrorOr write(int fd, void const* data, size_t data_size) return rc; } +ErrorOr kill(pid_t pid, int signal) +{ + if (::kill(pid, signal) < 0) + return Error::from_syscall("kill"sv, -errno); + return {}; +} + } diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h index cbc6339d49..140da81ebb 100644 --- a/Userland/Libraries/LibCore/System.h +++ b/Userland/Libraries/LibCore/System.h @@ -28,5 +28,6 @@ ErrorOr ftruncate(int fd, off_t length); ErrorOr stat(StringView path); ErrorOr read(int fd, void* buffer, size_t buffer_size); ErrorOr write(int fd, void const* data, size_t data_size); +ErrorOr kill(pid_t, int signal); }