Subject: Re: ps vs /proc
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Jaromir Dolecek <dolecek@ics.muni.cz>
List: current-users
Date: 02/22/2000 11:00:44
der Mouse wrote:
> The problem is, /proc *does* have a procfs mounted on it.  Is ps
> perhaps doing a getfsstat to see if a procfs is mounted there?  My
> kernel/user version skew is large enough that getfsstat() appears to be
> returning trash.

Mmm, strange. statfs() or struct statfs didn't change in ages, did it ?

Yes, ps's procfs fallback uses statfs() to be sure it's really
talking to procfs filesystem.

> Since the main use of the /proc fallback is dealing with
> kernel/userland version skew, I submit that this is at best suboptimal
> behavior; the fallback should be as robust as possible, which in
> particular means that if it looks even vaguely like a procfs it should
> be used, even if it seems dubious.

Is there any other safe way to find out if the filesystem is really
procfs without using statfs() ?

How old is your userland ?

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
@@@@  Wanna a real operating system ? Go and get NetBSD, damn!  @@@@