[SIGNAL] Added default implementation of killpg

klibc doesn't have killpg.  Since we only call it for valid values of
pid, we can call kill instead.
This commit is contained in:
Herbert Xu 2005-10-29 21:21:02 +10:00
parent f084cc9a34
commit 14c0903ea8
3 changed files with 15 additions and 2 deletions

View File

@ -12,6 +12,7 @@
* Fixed gcc 4.0 compilation problems.
* Added missing system.h inclusion for mempcpy.
* Added default implementation of strsignal.
* Added default implementation of killpg.
2005-10-26 Herbert Xu <herbert@gondor.apana.org.au>

View File

@ -23,8 +23,8 @@ dnl Checks for libraries.
dnl Checks for header files.
dnl Checks for library functions.
AC_CHECK_FUNCS(bsearch mempcpy getpwnam sigsetmask stpcpy strchrnul strsignal \
strtoimax strtoumax)
AC_CHECK_FUNCS(bsearch getpwnam killpg mempcpy sigsetmask stpcpy strchrnul \
strsignal strtoimax strtoumax)
dnl Check for klibc signal.
AC_CHECK_FUNC(signal)

View File

@ -27,6 +27,7 @@
*/
#include <signal.h>
#include <sys/types.h>
static inline void sigclearmask(void)
{
@ -67,3 +68,14 @@ char *strsignal(int);
void *bsearch(const void *, const void *, size_t, size_t,
int (*)(const void *, const void *));
#endif
#ifndef HAVE_KILLPG
static inline int killpg(pid_t pid, int signal)
{
#ifdef DEBUG
if (pid < 0)
abort();
#endif
return kill(-pid, signal);
}
#endif