Date: Fri, 3 Mar 2017 14:30:42 -0800 (PST) From: "Rodney W. Grimes" <freebsd-rwg@pdx.rh.CN85.dnsmgr.net> To: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com> Cc: Dirk-Willem van Gulik <dirkx@webweaving.org>, freebsd-hackers@freebsd.org Subject: Re: kill -0 <pid> --- side effect or supported Message-ID: <201703032230.v23MUg5b072955@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <11A4B6AB-E51D-4754-8E80-4503687E0F84@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
-- Start of PGP signed section.
[ Charset UTF-8 unsupported, converting... ]
>
> > On Mar 3, 2017, at 14:12, Dirk-Willem van Gulik <dirkx@webweaving.org> wrote:
> >
> > I regularly use 'kill -0 <pid>' on FreeBSD as a way to test if a certain process is still running (but without actually sending the signal). And I think it has worked reliably since the mid 80's.
> >
> > Is it actually a properly supported use - as I recently happened to notice that it does not seem to be all that documented in kill(
>
> It better work. I have code that relies on it :)?
>
> It does work as you noted, according to truss:
>
> # sudo truss -ff kill -0 1 2>&1
> ...
> 79940: kill(1,0) = 0 (0x0)
> ?
> #
>
> As noted in kill(2), this is one of the valid values:
>
> a group of processes. The sig argument may be one of the signals
> specified in sigaction(2) or it may be 0, in which case error checking is
^^^^^^^^^^^^^^^^
That bit of information should be promoted from kill(2) to kill(1) by
adding 0 to the list as ?.
> performed but no signal is actually sent. This can be used to check the
> validity of pid.
>
> So, the manpage for kill(1) is just lacking in the sense that -0 is supported.
>
> Cheers!
> -Ngie
-- End of PGP section, PGP failed!
--
Rod Grimes rgrimes@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703032230.v23MUg5b072955>
