mirror of
https://salsa.debian.org/debian/dash.git
synced 2026-01-26 15:39:05 +00:00
[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:
parent
f084cc9a34
commit
14c0903ea8
@ -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>
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
12
src/system.h
12
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user