realpath(3) bugs

Casper.Dik-QHcLZuEGTsvQT0dZR+AlfA
2012-05-04T11:22:13Z

For some reason, many of the realpath() manual pages (BSD, Linux) have
words to the following effect:

Solaris may return a relative pathname when the path argument is relative.

I have looked through the Solaris source files and have found no
such bug reported or fixed; the implementation from at least 1997 and
beyond certainly doesn't have this problem and even the older versions
prepend getcwd() or chdir() to dirname and run getcwd() in that
directory.

Solaris does have a system call which may return relative pathnames:
resolvepath(). I believe that that function may have confused earlier
writers of realpath() manual pages and this was later copied without
verifying that fact.

realpath() existed in Solaris 2.0 as it came from SVr4.0 and even at that
time i t returned the full, non-relative path.

Casper Dik (Solaris Engineering)