From 12d6f1fd73ab6f5b66bfcb4a61cd6e77de9be45b Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Thu, 11 Jul 2013 23:22:53 +0200 Subject: [PATCH] Add killpg(3). --- libc/Makefile | 1 + libc/signal/killpg.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 libc/signal/killpg.cpp diff --git a/libc/Makefile b/libc/Makefile index 97e2a8ee..dafe6359 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -224,6 +224,7 @@ poll/poll.o \ poll/ppoll.o \ pwd/pwent.o \ signal/kill.o \ +signal/killpg.o \ signal/psignal.o \ signal/raise.o \ signal/sigaction.o \ diff --git a/libc/signal/killpg.cpp b/libc/signal/killpg.cpp new file mode 100644 index 00000000..00bee597 --- /dev/null +++ b/libc/signal/killpg.cpp @@ -0,0 +1,30 @@ +/******************************************************************************* + + Copyright(C) Jonas 'Sortie' Termansen 2013. + + This file is part of the Sortix C Library. + + The Sortix C Library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + The Sortix C Library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with the Sortix C Library. If not, see . + + signal/killpg.cpp + Send signal to a process group. + +*******************************************************************************/ + +#include + +extern "C" int killpg(pid_t pgid, int signum) +{ + return kill(-pgid, signum); +}