From owner-freebsd-hackers Wed Dec 5 15: 3: 1 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.acns.ab.ca (h24-64-56-135.cg.shawcable.net [24.64.56.135]) by hub.freebsd.org (Postfix) with ESMTP id E16A237B416 for ; Wed, 5 Dec 2001 15:02:58 -0800 (PST) Received: from colnta.acns.ab.ca (colnta.acns.ab.ca [192.168.1.2]) by mail.acns.ab.ca (8.11.6/8.11.3) with ESMTP id fB5N2pX06837; Wed, 5 Dec 2001 16:02:52 -0700 (MST) (envelope-from davidc@colnta.acns.ab.ca) Received: (from davidc@localhost) by colnta.acns.ab.ca (8.11.6/8.11.3) id fB5N2pH20350; Wed, 5 Dec 2001 16:02:51 -0700 (MST) (envelope-from davidc) Date: Wed, 5 Dec 2001 16:02:51 -0700 From: Chad David To: Wayne Pascoe Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Repost - f_type value in statfs structure Message-ID: <20011205160251.A20136@colnta.acns.ab.ca> Mail-Followup-To: Wayne Pascoe , freebsd-hackers@FreeBSD.ORG References: <86wv01tijn.fsf@pan.home.penguinpowered.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <86wv01tijn.fsf@pan.home.penguinpowered.org.uk>; from freebsd@molemanarmy.com on Wed, Dec 05, 2001 at 10:21:16PM +0000 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 On Wed, Dec 05, 2001 at 10:21:16PM +0000, Wayne Pascoe wrote: > 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. Check for the MNT_LOCAL flag in f_flags. For example: #include #include #include #include int main() { struct statfs *fs, *fsa; int cnt; cnt = getmntinfo(&fsa, 0); if (!cnt) { fprintf(stderr, "getmntinfo() failed\n"); exit(1); } for (fs = fsa; cnt != 0; fs++, cnt--) printf("%s %d\n", fs->f_fstypename, (fs->f_flags & MNT_LOCAL) == MNT_LOCAL); exit(0); } Hope that helps. -- Chad David davidc@acns.ab.ca ACNS Inc. Calgary, Alberta Canada To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message