Hi all,

Sorry to repost this, but I'm still trying to nail this issue. Any
assistance would be much appreciated.

I've written an application that uses getmntinfo which creates an
array of statfs structs and stores information about mounted
filesystems there.

The issue that I am having is detecting valid filesystems to do
further checks on. I am only interested in checking local filesystems
such as UFS. 

Originally I was checking to see if f_type in the created struct was a
certain number. The man page described this as being 
int     f_type;           /* type of filesystem */

I have now had to revert to checking f_fstypename against a string
(ufs only for now) because f_type seems to contain different numbers
for the same f_fstypename on different machines.

Eg on three different machines running FreeBSD 4.4-STABLE I got 
1, 3 and 5 for f_type where the f_fstypename was ufs.

Is the f_type supposed to be consistent? If so, where is this normally
defined? If the f_type is not supposed to be consistent, is there any
way to check a the filesystem in the current statfs struct against a
list of values without having to do 

if ( (strcmp(mounted_fs[count].f_fstypename, "ufs") != 0) ||
     (strcmp(mounted_fs[count].f_fstypename, "hfs") !=0) )

? 

Thanks 

-- 
- Wayne Pascoe
                                 | I haven't lost my mind...
[EMAIL PROTECTED]          | It's backed up on tape somewhere.
http://www.molemanarmy.com       | 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to