From owner-freebsd-audit Sun Aug 26 0:24:13 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id AB2B537B407 for ; Sun, 26 Aug 2001 00:24:10 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id RAA32082; Sun, 26 Aug 2001 17:24:02 +1000 Date: Sun, 26 Aug 2001 17:23:53 +1000 (EST) From: Bruce Evans X-X-Sender: To: Thomas Gellekum Cc: Subject: Re: RFC: statvfs(3) In-Reply-To: Message-ID: <20010826165751.D15568-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 24 Aug 2001, Thomas Gellekum wrote: > here's a simple implementation of statvfs(3), which is mandated by > SUSV2. > > I'd welcome suggestions on how to deal with the f_namemax member of > struct statvfs. Currently the functions return PATH_MAX for it, but > this is probably wrong for some filesystem types. We could convert one Use [f]pathconf(). Use it with _PC_NAME_MAX, not with _PC_PATH_MAX. This is a little bogus, but works under FreeBSD. Under FreeBSD: - PATH_MAX is the same for all filesystems, since it is handled by vfs. - NAME_MAX is filesystem-dependent, so it is a bug for to define it. - pathconf() with _PC_NAME_MAX or _PC_PATH_MAX works for all types of files (POSIX only requires it to work for directories). Thus you don't have to worry about [f]pathconf() not working for the descriptor or path passed to [f]statvfs(). > of the f_spare* members in struct statfs (I'd prefer 'long f_spare[2]' > -> 'long f_namemax; long f_spare') and define a _PATH_MAX (in > ?) to initialize that for every filesystem type. Not necessary or useful. It's bogus that POSIX doesn't require pathconf(..., _PC_NAME_MAX) to work for non-directories, yet it apparently requires f_namemax to work for all files on the filesystem ([f]statvfs() is specified in POSIX.1-200x, but the semantics of f_namemax are fuzzy). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message