[net.bugs.4bsd] Kill

ptw@encore.UUCP (P. Tucker Withington) (03/27/86)

The kill(2) man page in both 4.2bsd and Sun Release 2.0 states:

	If the process number is 0, the signal is sent to *all other*
	processes in the sender's process group; this is a variant of
	killpg(2).  (emphasis mine)

Maybe I'm expecting too much of the English language, but I interpret
this statement to mean: whereas killpg sends to everyone in a process
group, you can use kill to send to everyone except yourself (obviating
a signal/SIGIGNORE call).

The following test program demonstrates that this is not how kill is
implemented:

	main() {
		kill(0, SIGQUIT);
	}

causes a core dump of itself.

I don't have my historical manuals in front of me, so I can't say when
this language was introduced to the kill(2) man page, but it clearly
diverges from the System V man page and the Sun and Vax
implementations.  I always have assumed kill(0, ...) does what it does
and am puzzled by the propagation of the wording in the man page.  Is
it just sloppy English, or did someone actually think this was a
useful feature and document it but never implement it?  I expect a
number of things would break if kill actually did what I interpret the
man page to say it does.

			o.o	--ptw
			 ~

hwe@lanl.ARPA (Skip Egdorf) (03/28/86)

> The kill(2) man page in both 4.2bsd and Sun Release 2.0 states:
> 
> 	If the process number is 0, the signal is sent to *all other*
> 	processes in the sender's process group; this is a variant of
> 	killpg(2).  (emphasis mine)
> 
	...
> 
> I don't have my historical manuals in front of me, so I can't say when
> this language was introduced to the kill(2) man page, but it clearly
> diverges from the System V man page and the Sun and Vax
> implementations.  I always have assumed kill(0, ...) does what it does
> and am puzzled by the propagation of the wording in the man page.  Is
> it just sloppy English, or did someone actually think this was a
> useful feature and document it but never implement it?  I expect a
> number of things would break if kill actually did what I interpret the
> man page to say it does.
> 
> 			o.o	--ptw
> 			 ~

From V7 1979:

	kill(2)...

	if the process number is 0, the signal is sent to all other
	processes in the sender's process group; see tty(4).

My V6 manuals are at home, not here...
Any one have a set from PWB??

		Skip Egdorf
		egdorf@lanl.ARPA

thomas@utah-gr.UUCP (03/30/86)

Skip Egdorf points out that the wording in question appears in the V7
manual, and wonders about V6.  Well, V6 didn't have process groups, but
we find the sentence:
	If the process number is 0, the signal is sent to all other
	processes with the same controlling typewriter and user ID.

Furthermore:
	In no case is it possible for a process to kill itself.

The manual page for kill(II) is dated 12/15/74.

-- 
=Spencer   ({ihnp4,decvax}!utah-cs!thomas, thomas@utah-cs.ARPA)

honey@down.FUN (Peter Honeyman) (04/02/86)

this is degenerating into a game of one-ups-manual-ship, but here's the
v5 language (ca. 1973) for kill(2):

    SYNOPSIS
	sys kill; sig
	kill(pid, sig)

    DESCRIPTION
	Kill sends the signal sig to the process specified by the
	process number in r0.  See signal(2) for a list of signals.

	The sending and receiving processes must have the same
	controlling typewriter, otherwise this call is restricted to
	the super-user.

    BUGS
	Equality between the controlling typewriters of the sending and
	receiving process is neither a necessary nor sufficient
	condition for allowing the sending of a signal.  The correct
	condition is equality of user IDs.


-- peter