Subject: Re: ps vs /proc
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Brian C. Grayson <>
List: current-users
Date: 02/23/2000 23:42:46
On Tue, Feb 22, 2000 at 01:37:40PM -0500, der Mouse wrote:
> I still think ps should be less stringent about what it demands of
> /proc before it's willing to give it the benefit of the doubt.

  Look at the threads in tech-userlevel from March 1999, when I
first committed the ps /proc fallback.  :)

  I got the feeling at that time from the discussions that it was
better to give no information than possibly-erroneous
information.  That's why ps (when using the /procfs fallback) does
an open, followed by verify_procfs_fd(), every time it examines a
file.  Talk about paranoia!

<Snipped from your first note:>
% ps ax
ps: proc size mismatch (24192 total, 744 chunks).
ps: /proc exists but does not have a procfs mounted on it.
ps: fallback /proc-based lookup also failed.  Giving up...  

  Hm.  Line 223 of procfs_ops.c does a strcmp of the returned
f_fstypename against MOUNT_PROCFS (defined in
/usr/include/sys/mount.h), which is what failed.  It might be
interesting, if you haven't already upgraded the whole system,
to have the warning print out what kind of filesystem it
_thinks_ it is.  It'll probably just be "ocfs" or "fs"...  :)