Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Aug 2006 07:51:21 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Yar Tikhiy <yar@comp.chem.msu.su>
Cc:        Dag-Erling Sm?rgrav <des@des.no>, Marcel Moolenaar <marcel@FreeBSD.org>, cvs-all@FreeBSD.org, src-committers@FreeBSD.org, cvs-src@FreeBSD.org
Subject:   Re: cvs commit: src/usr.sbin/kldxref kldxref.c
Message-ID:  <20060810073617.V16211@delplex.bde.org>
In-Reply-To: <20060808101524.GN54416@comp.chem.msu.su>
References:  <200608042128.k74LShD7052071@repoman.freebsd.org> <8664h6ci86.fsf@xps.des.no> <20060807133921.V6590@delplex.bde.org> <20060808101524.GN54416@comp.chem.msu.su>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, 8 Aug 2006, Yar Tikhiy wrote:

> On Mon, Aug 07, 2006 at 01:59:30PM +1000, Bruce Evans wrote:
>> On Sun, 6 Aug 2006, Dag-Erling [iso-8859-1] Smørgrav wrote:
>>> MAXPATHLEN should be spelled PATH_MAX.
>>
>> Actually, MAXPATHLEN is better since it is honestly unportable.  It works
>> ...
> Just looked what SUSv3 says:
>
> 	It should be noted, however, that many of the listed limits
> 	are not invariant, and at runtime, the value of the limit
> 	may differ from those given in this header, for the following
> 	reasons:

It should say somewhere that the limits shall not be defined if they
are not invariant.  POSIX says this.  There are only a few limits
that are guaranteed to be compile-time constants (except for some
not very useful ones which give absolute minimum values).

>
> 	The limit is pathname-dependent.
>
> 	The limit differs between the compile and runtime machines.
>
> 	For these reasons, an application may use the fpathconf(),
                                           ^^^
> 	pathconf(), and sysconf() functions to determine the actual
> 	value of a limit at runtime.

It should say "must", or at least "should", since not using pathconf()
etc. won't work if the limit is undefined.

It's an implementation detail that PATH_MAX^WMAXPATHLEN is independent
of the file system (this is because everything goes through vfs_lookup()).
The related limit NAME_MAX is very fs-dependent.  FreeBSD bogusly defines
NAME_MAX, OPEN_MAX, CHILD_MAX, ...

Bruce

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