Maybe I misunderstand what you're asking for, but isn't Dpathconf the right way to retrieve this information?
That's not a good idea when you *have* to use PATH_MAX. Many software for unix etc.
require a buffer to be at least PATH_MAX sized.So if you pass them what Dpathconf returns, it may differs from the definiton of PATH_MAX which was used when you compiled the library which requires a buffer to
be at least PATH_MAX in size ;) Greets, Ole