Re: if_exist_pid()

Kasper Dupont (kasperd@daimi.au.dk)
Tue, 16 Jul 2002 19:42:06 +0200


"Richard B. Johnson" wrote:
>
> Anybody know the 'correct' way of determining if a pid still
> exists? I've been using "kill(pid, 0)" and, if it does not
> return an error, it is supposed to exist.

That is correct.

> Sending signal 0 to a pid sometimes returns 0, even if the pid
> is long-gone

Really? That would mean there is a bug in kill(). Of course
you can get return value 0 if the pid has been recycled, but
otherwise it should not happen.

-- 
Kasper Dupont -- der bruger for meget tid på usenet.
For sending spam use mailto:razrep@daimi.au.dk
or mailto:mcxumhvenwblvtl@skrammel.yaboo.dk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/