[talk] kill -0

Christos Zoulas christos at zoulas.com
Mon May 13 08:55:31 EDT 2019


https://pubs.opengroup.org/onlinepubs/009695399/functions/kill.html <https://pubs.opengroup.org/onlinepubs/009695399/functions/kill.html>

christos

> On May 13, 2019, at 8:53 AM, Okan Demirmen <okan at demirmen.com> wrote:
> 
> On Fri 2019.05.10 at 14:13 -0400, Raul Cuza wrote:
>> On Fri, May 10, 2019 at 2:09 PM Jan Schaumann <jschauma at netmeister.org> wrote:
>>> 
>>> Raul Cuza <raulcuza at gmail.com> wrote:
>>> 
>>>> I just had someone submit a shell script using `kill -0 ${PID}` to
>>>> test if a process is running. It exits non-zero if ${PID} isn't a
>>>> running process and zero otherwise. But...
>>>> 
>>>> http://nixdoc.net/man-pages/FreeBSD/kill.1.html says nothing about it.
>>> 
>>> kill(2) describes this behavior:
>>> 
>>> "sig may be one of the signals specified in
>>> sigaction(2) or it may be 0, in which case error
>>> checking is performed but no signal is actually sent.
>>> This can be used to check the validity of pid."
>>> 
>>> -Jan
>> 
>> I will update my brain and not be "that PR reviewer". Thank you!
> 
> It's documented in both kill(2) and kill(1) on OpenBSD at least.
> 
> _______________________________________________
> talk mailing list
> talk at lists.nycbug.org <mailto:talk at lists.nycbug.org>
> http://lists.nycbug.org:8080/mailman/listinfo/talk <http://lists.nycbug.org:8080/mailman/listinfo/talk>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nycbug.org:8080/pipermail/talk/attachments/20190513/7e8028dc/attachment.html>


More information about the talk mailing list