summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-10-29 21:21:02 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2005-10-29 21:40:05 +1000
commit14c0903ea8e6e04e50298ababa9d0a9183dfeb39 (patch)
treefce25aa3f434670264f80ae7f2c1deeb3e06bb4d /src
parent[SIGNAL] Added default implementation of strsignal (diff)
downloaddash-14c0903ea8e6e04e50298ababa9d0a9183dfeb39.tar.gz
dash-14c0903ea8e6e04e50298ababa9d0a9183dfeb39.zip
[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.
Diffstat (limited to '')
-rw-r--r--src/system.h12
1 files changed, 12 insertions, 0 deletions
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