Distinguish realpath(3) implementation

Sevan Janiyan <[email protected]> Mon, 6 Oct 2025 01:36:22 +0100
Newsgroups gmane.comp.sysutils.autoconf.general
Message-ID <[email protected]>
Hi,
realpath(3) has been around for quite some time now, but with 
POSIX.1-2008 its signature changed and gained the ability to 
auto-allocate memory, whereas the original implementation needed things 
to be done in prep before calling realpath().

It seems it's not so much a problem on Solaris 10 as you can assume the 
new behaviour and check the value of $errno, and if it was invalid, 
resort to the old way of doing things.

That's Solaris 10, on ancient OS X (darwin 8 and older), program crashes 
on the first call to realpath with bus error, so you never get beyond that.

Would this be something that autoconf could check for out of the box and 
provide the relevant definitions to the use in code? so you can skip on 
implementing the logic to work out which realpath is available, whether 
in code, or as an autoconf check.

Sincerely,


Sevan