FILENAME_MAX & _POSIX_PATH_MAX relationship?

David A Willcox willcox at urbana.mcd.mot.com
Thu Apr 11 23:15:01 AEST 1991


Submitted-by: willcox at urbana.mcd.mot.com (David A Willcox)

>>Would someone who knows please tell me the relationship between the
>>Standard C macro FILENAME_MAX and the POSIX macro _POSIX_PATH_MAX.

>_POSIX_PATH_MAX is more appropriate.  Standard C has no notion of a
>path prefix.  Clause 4.9.1 of both the Standard and its rationale
>tells us that a buffer of FILENAME_MAX characters should hold
>the entire file name (what POSIX.1 would term the 'path').

_POSIX_PATH_MAX is probably not the correct value, unless your
implementation never supports anything larger than the minimum
required by POSIX.  PATH_MAX would be better, if it's defined on your
implementation (implying that you don't need to call pathconf() to get
a path-specific value).  If PATH_MAX isn't defined, then FILENAME_MAX
must be no smaller than the largest value you can get from
pathconf(_PC_PATH_MAX,...).

David A. Willcox		"Just say 'NO' to universal drug testing"

[ Standards are such lovely things... -mod ]

Volume-Number: Volume 23, Number 28



More information about the Comp.std.unix mailing list