[talk] kill -0

Okan Demirmen okan at demirmen.com
Mon May 13 08:53:15 EDT 2019


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.



More information about the talk mailing list