pgrep strangeness

Garance A Drosihn drosih at rpi.edu
Tue Mar 30 06:01:18 PST 2004


At 7:06 PM +1000 3/30/04, Tim Robbins wrote:
>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.

I actually asked if I should change that to use KERN_PROC_PROC in some
mailing list or another, but I don't think anyone replied.  I don't do
much of anything with threads, so they're about the same for me.
I'll change it to KERN_PROC_PROC.

Thanks.

-- 
Garance Alistair Drosehn            =   gad at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the freebsd-current mailing list