From owner-freebsd-hackers Mon Dec 3 6:59:12 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from clientmail.realtime.co.uk (simian.realtime.co.uk [213.52.146.137]) by hub.freebsd.org (Postfix) with ESMTP id BBA4B37B416 for ; Mon, 3 Dec 2001 06:59:08 -0800 (PST) Received: from pan.ehsrealtime.com ([213.52.146.196]) by clientmail.realtime.co.uk with esmtp (Exim 3.20 #1) id 16AuYl-0005we-01 for freebsd-hackers@freebsd.org; Mon, 03 Dec 2001 14:59:07 +0000 Received: from waynep by pan.ehsrealtime.com with local (Exim 3.33 #1) id 16AuWs-0000oC-00 for freebsd-hackers@freebsd.org; Mon, 03 Dec 2001 14:57:10 +0000 From: Wayne Pascoe To: freebsd-hackers@freebsd.org Subject: Application using getmntinfo and statfs Date: 03 Dec 2001 14:57:10 +0000 Message-ID: <86elmc1hdl.fsf@pan.ehsrealtime.com> Lines: 38 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, 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 | What we need is either less corruption, freebsd@molemanarmy.com | or more chance to participate in it. http://www.molemanarmy.com | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message