Subject: Re: killpg() gone?
To: Gandhi woulda smacked you <greywolf@starwolf.com>
From: None <seebs@plethora.net>
List: current-users
Date: 04/07/1999 16:11:09
In message <Pine.NEB.4.02.9904071327410.3194-200000@starwolf.starwolf.com>, Gan
dhi woulda smacked you writes:
>I looked under /usr/include/sys/syscall.h and killpg is nowhere
>to be found, save a 4.3 compatibility reference.

`man 2 kill` says

     If pid is zero:
             sig is sent to all processes whose group ID is equal to the pro-
             cess group ID of the sender, and for which the process has per-
             mission; this is a variant of killpg(3).

and killpg.c says

        return (kill(-pgid, sig));

`man 2 kill` also says
     For compatibility with System V, if the process number is negative but
     not -1, the signal is sent to all processes whose process group ID is
     equal to the absolute value of the process number.  This is a variant of
     killpg(3).

but since killpg is implemented in terms of this, I think this should become
a first-class feature.

># kill -1 -3003
>-3003: No such process

Hmm.  All it does is strtol() and pass it to kill.

>So the shell can't kill process groups, and perl can't kill process
>groups via perl::kill(), and I can't find the syscall number for
>killpg() to have perl call it directly.

There isn't one because it's no longer a syscall; it's a libc compat function,
whose functionality is provided by an extension to kill(2).

Hmm.  The source for kill sure looks like it should DTRT with this.

-s