Re: Kill system call

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Fri, 22 Mar 1996 08:27:38 +0100


On 21 Mar 96 at 12:57, Theodore Ts'o wrote:

> POSIX.1 states:
>
> 3.2.2.2 Description of kill()
>
> "...If sig is zero (the null signal), error checking is performed, but no
> signal is actually sent. The null signal can be used to check the
> validity of pid...."

"No signal is sent" implies that the signal error checking does not
happen; only the existence of the PID is checked.

>
> 3.2.2.4 Errors
>
> "If any of the following conditions occur, the kill() function shall
> return -1 and set errno to the corresponding value:
>
> ....
>
> [EPERM] The process does not have permission to send the signal
> to any receiving process."

Well, 0 is no valid signal in a strict sense, it's just an additional
feature to check the validity of a PID.

>
> So technically, what we're doing is allowed by POSIX.1, and POSIX is
> somewhat ambiguous about whether or not the OS must return an error when
> sig is 0 and you don't have permission to send a signal to the process.

All add-ons are somewhat clumsy.

>
> My read on the standards language is that what we are doing now is
> definitely in compliance, but adding an extension to so that any process
^^^^^^^^^^ "possibly" I'd like to say, but the definition is
confusing.

> is allowed to send the null process to any other process is *probably*
> within the bounds allowed by POSIX.1, as long as we so documented this
> in our POSIX.1 conformance document. (Generating this document is part
> of the POSIX.1 conformance process which Linux-FT spent a very large
> amount of money to obtain the POSIX.1 certification.)
>
> - Ted
Ulrich