From owner-freebsd-current Sun Oct 18 10:41:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA17378 for freebsd-current-outgoing; Sun, 18 Oct 1998 10:41:01 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA17372 for ; Sun, 18 Oct 1998 10:40:46 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.9.1/8.9.1/Spinner) with ESMTP id BAA01986; Mon, 19 Oct 1998 01:39:33 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199810181739.BAA01986@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Chuck Robey cc: freebsd-current@FreeBSD.ORG Subject: Re: mount flags In-reply-to: Your message of "Sun, 18 Oct 1998 13:16:28 -0400." Date: Mon, 19 Oct 1998 01:39:32 +0800 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Chuck Robey wrote: > On Mon, 19 Oct 1998, Peter Wemm wrote: > > > Chuck Robey wrote: > > [..] > > > I have a very recently broke thing that was happily using a call to > > > statfs, to tell if it was an NFS filesystem or not. Last time I had > > > occasion to take a look at this, there were flags of the sort MOUNT_XXX, > > > where the XXX could have been UFS, MFS, NFS, etc. The application is > > > specifically looking for MOUNT_NFS, and it's just not around anymore, > > > that I can find. > > > > > > I would be happy to find it, but I suspect that the method for detecting > > > an NFS mounted FS has changed, so that the app should no longer use > > > statfs. That's kind of odd, because this port works on a lot of other > > > systems which seem to do that fine. > > > > What's wrong with the f_fstypename[] field in struct statfs? It'll > > contain a string "nfs" or "ufs" etc.. > > I looked in the statfs man page and couldn't see any kind of definition > of what went in that field (so as to use it to choose from). I took a > quick look at the code, nothing immediately jumps out at me ... for an > external system interface, it's certainly obscurely set up, isn't it? > > Do you know where the derivation of the f_fstypename values comes from? > I just can't find it. Hmm.. Now that you mention it... I don't see where it's being set either. I'm not sure that it is being set at all... :-( Short term hack: look at f_type in the statfs struct, and use the getvfsent() routines to map that back into a type name. According to : /usr/include/sys/mount.h:struct ovfsconf *getvfsbytype __P((int)); This is a bit of a kludge but it should work. struct ovfsconf has a char vfc_name[32] field. In these instances, the strings come from a result of the VFS_SET() macro and the configuration data it creates. Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message