cvs commit: src/bin/ps ps.1 ps.c
Garance A Drosehn
gad at FreeBSD.org
Wed Mar 17 16:37:01 PST 2004
At 2:59 PM -0800 3/17/04, Nate Lawson wrote:
>On Wed, 17 Mar 2004, Garance A Drosehn wrote:
>> Modified files:
>> bin/ps ps.1 ps.c
>> Log:
> > Improvements to 'ps -p <x>'. If <x> is a process id that does
> > not exist, then just print the header (if any) and exit, thus
> > matching the behavior on -stable and other OS's.
>If not found, shouldn't it print no header, an error message to
>stderr and return non-zero?
It isn't clear from SUSv3 if it should do that. And, as mentioned,
the behavior in -stable is the same as the behavior on other OS's,
so I felt that it was reasonable to keep that behavior in -current.
Further, 'ps -U someuser' does not give an error message when there
are no processes matching that user. 'ps' only does that if there
is no userid named 'someuser'. It's the same for 'ps -t /dev/ttyx'.
Also consider the (now supported) case of: ps -p 1,12790
if process #1 does exist, and process #12790 does not exist. Do
you really want 'ps' to abort in that case, with a message to
stderr? I do not feel that is desirable.
However, in some further checking on other OS's, I do see that
'ps' does seem to return non-zero if there are no processes which
match the given process-list or user-list. And we also seem to
do that for '-u someuser'. Given that I basically copied the
userlist code to create the support for process-lists, I will
have to check why 'ps' does a zero-return in some cases where
no processes are matched. I didn't intend that. I'll try to
get that fixed tonight.
--
Garance Alistair Drosehn = gad at gilead.netel.rpi.edu
Senior Systems Programmer or gad at FreeBSD.org
Rensselaer Polytechnic Institute; Troy, NY; USA
More information about the cvs-src
mailing list