Re: pgrep strangeness

From: Tim Robbins <tjr_at_freebsd.org>
Date: Tue, 30 Mar 2004 19:06:19 +1000
On Tue, Mar 30, 2004 at 12:47:11PM +0400, Andrey Chernov wrote:

> See the picture below. Why it print PID found 3 times?
> Is it because too many 'sentinel's in the command line?
> It looks like some analog of 'sort -u' should be performed (qsort(3)?)
> 
> # pgrep sentinel
> 547
> 547
> 547
> # ps ax | grep sentinel
>   547  ??  Ss     7:48,83 /usr/local/sbin/sentinel -v1 -c /usr/local/etc/sentinel

I think this is the same bug I fixed in killall a while ago -- it uses
KERN_PROC_ALL, which returns an entry for each thread in the process,
instead of KERN_PROC_PROC.


Tim
Received on Mon Mar 29 2004 - 23:04:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:49 UTC