From owner-freebsd-hackers Wed Dec 5 14:23:20 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from gadolinium.btinternet.com (gadolinium.btinternet.com [194.73.73.111]) by hub.freebsd.org (Postfix) with ESMTP id 6443A37B41B for ; Wed, 5 Dec 2001 14:23:17 -0800 (PST) Received: from host217-35-31-173.in-addr.btopenworld.com ([217.35.31.173] helo=marvin.penguinpowered.org.uk) by gadolinium.btinternet.com with esmtp (Exim 3.22 #8) id 16BkRf-0002Ud-00 for freebsd-hackers@freebsd.org; Wed, 05 Dec 2001 22:23:15 +0000 Received: from [192.168.10.11] (helo=pan.realtime.co.uk) by marvin.penguinpowered.org.uk with esmtp (Exim 3.33 #1) id 16BkVl-0009fS-00 for freebsd-hackers@freebsd.org; Wed, 05 Dec 2001 22:27:29 +0000 Received: from waynep by pan.realtime.co.uk with local (Exim 3.33 #1) id 16BkPk-0000Co-00 for freebsd-hackers@freebsd.org; Wed, 05 Dec 2001 22:21:16 +0000 From: Wayne Pascoe To: freebsd-hackers@freebsd.org Subject: Repost - f_type value in statfs structure Date: 05 Dec 2001 22:21:16 +0000 Message-ID: <86wv01tijn.fsf@pan.home.penguinpowered.org.uk> Lines: 41 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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... freebsd@molemanarmy.com | It's backed up on tape somewhere. http://www.molemanarmy.com | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message