summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog1
-rw-r--r--configure.ac4
-rw-r--r--src/system.h12
3 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3737c89..1940a8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
diff --git a/configure.ac b/configure.ac
index 424ffee..25877b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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)
diff --git a/src/system.h b/src/system.h
index 0842675..1242e24 100644
--- a/src/system.h
+++ b/src/system.h
@@ -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