statfs problem with NFS filesystems

Christopher Lott cml at cheops.cis.ohio-state.edu
Thu Dec 29 03:59:26 AEST 1988


Hi,

I am trying to solve this problem:

given a path name, determine the host machine and host filesystem
for that path. 

The machine name is needed because the host filesystem may be NFS.  

I used (successfully!) the statfs() system call to get the filesystem id pair,
and it worked great on our sun systems.  But alas, all the world is not a vax,
although this may not be the problem :-).

The statfs() call on the pyramid returns a good id pair for LOCAL filesystems,
but always returns the same pair of numbers for NFS fs's.

I quote:

STATFS(2-ucb)     Pyramid OSx Operating System      STATFS(2-ucb)
NAME
     statfs, fstatfs - get file system statistics
....much deleted...
          struct statfs {
	...more deleted...
                 fsid_t  f_fsid;     /* file system id */
		 ^^^^^^^^^^^^^^   <-- WHAT I NEED!
          };

These come back as (2820, 0) every time.   Yuck.

Has anyone else dealt with this?  Can anyone suggest a better way to
determine the host filesystem?  I would rather NOT do string matching
using /etc/mtab because that just isn't deterministic enough.

Thanks in advance for any and all help.

chris...
-=-
cml at tut.cis.ohio-state.edu   Computer Science Department, OSU     614-292-6546
 or:  ...!{att,pyramid,killer}!osu-cis!cml		<standard disclaimers>



More information about the Comp.sys.pyramid mailing list