Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Aug 2001 17:23:53 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Thomas Gellekum <tg@melaten.rwth-aachen.de>
Cc:        <freebsd-audit@FreeBSD.ORG>
Subject:   Re: RFC: statvfs(3)
Message-ID:  <20010826165751.D15568-100000@besplex.bde.org>
In-Reply-To: <kqitfdwvek.fsf@cip12.melaten.rwth-aachen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <limits.h> 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 <FS>_PATH_MAX (in
> <sys/param.h>?) 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010826165751.D15568-100000>