diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-02-16 23:35:41 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-02-16 23:35:41 (GMT) |
commit | b2c92f44d4572615b14671a5b3d0cace1c2b1511 (patch) | |
tree | 7b096e5f897ebe77875c840db97f789830e5091e /Modules | |
parent | b4779c3496b9aea6fca7717015985e72e9127a2e (diff) | |
download | cpython-b2c92f44d4572615b14671a5b3d0cace1c2b1511.zip cpython-b2c92f44d4572615b14671a5b3d0cace1c2b1511.tar.gz cpython-b2c92f44d4572615b14671a5b3d0cace1c2b1511.tar.bz2 |
Patch #511193: Implement killpg in posixmodule.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 31c991c..25da18f 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2199,6 +2199,24 @@ posix_kill(PyObject *self, PyObject *args) } #endif +#ifdef HAVE_KILLPG +static char posix_killpg__doc__[] = +"killpg(pgid, sig) -> None\n\ +Kill a process group with a signal."; + +static PyObject * +posix_killpg(PyObject *self, PyObject *args) +{ + int pgid, sig; + if (!PyArg_ParseTuple(args, "ii:killpg", &pgid, &sig)) + return NULL; + if (killpg(pgid, sig) == -1) + return posix_error(); + Py_INCREF(Py_None); + return Py_None; +} +#endif + #ifdef HAVE_PLOCK #ifdef HAVE_SYS_LOCK_H @@ -5573,6 +5591,9 @@ static PyMethodDef posix_methods[] = { #ifdef HAVE_KILL {"kill", posix_kill, METH_VARARGS, posix_kill__doc__}, #endif /* HAVE_KILL */ +#ifdef HAVE_KILLPG + {"killpg", posix_killpg, METH_VARARGS, posix_killpg__doc__}, +#endif /* HAVE_KILLPG */ #ifdef HAVE_PLOCK {"plock", posix_plock, METH_VARARGS, posix_plock__doc__}, #endif /* HAVE_PLOCK */ |