Question on 'ps -p <n>' in current

From: Garance A Drosihn <drosih_at_rpi.edu>
Date: Mon, 8 Mar 2004 21:40:21 -0500
This topic may have come up before, a long time ago, and I just
missed it.  If so, apologies for the repeat.

On stable, if you say 'ps -p <n>', and there is no process '<n>',
then you get the header-line from 'ps' and nothing else.  The
command-status is set to indicate failure.

On -current, the same command gives you the error message:

ps: kvm_getprocs: No such process

and you get no header line.  Other OS's also give you the header
line and no special error message.

I think this behavior in current is an unplanned side-effect of
the change in revision 1.46 of
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libkvm/kvm_proc.c

where that was fixing a side-effect of a fix in revision 1.60
of malloc.c.

In some other OS's, 'ps' behaves the way it does for us in -stable.
Looking at SUSv3, it's not clear to me if either behavior is
preferred.

Should 'ps' in this situation behave like it does in -stable? Or
is this a change that we deliberately wanted to make in -current?
I would be willing to change 'ps' if people prefer the earlier
behavior, but I'll leave it alone if this was an intentional change.

-- 
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
Received on Mon Mar 08 2004 - 17:40:23 UTC

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