On Mon, 19 Mar 2007, [EMAIL PROTECTED] wrote:
On Sat, 17 Mar 2007, Roland Mainz wrote:
[ ... ]
AFAIK PATH_MAX can be handled per filesystem (e.g $ getconf PATH_MAX
/tmp #), right ?
pathconf(2), and/or check VOP_PATHCONF() calls/backends in the source.
getconf(1) calls pathconf(2).
Of course it does, just meant to say that from an application point of
view, you:
- shouldn't call system("getconf ...") but pathconf(...) if
you're interested in whether your app's requirements are met
- can rely on the minimum possible pathname size PATH_MAX if
you know that'll be enough.
The question was, how does the existance of the query help an application.
Well, it does - the app can assume a minimum, and if that is insufficient
query the fs whether it offers "better".
So you can do something like:
if (required_pathmax > PATH_MAX) {
realpathmax = fpathconf(wdfd, _PC_PATH_MAX);
if (realpathmax < required_pathmax)
return (PATHMAX_TOOSMALL);
}
return (PATHMAX_SUFFICIENT);
instead of outrightly rejecting a system that doesn't have PATH_MAX of
your expectations.
FrankH.
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code