The man page for realpath
on my Linux box says:
VERSIONS
On Linux this function appeared in libc 4.5.21.
Now what does that mean? To which libc is it referring - "Linux libc"? - and where can I find a list that matches up the different libc flavors, so I can see what the minimum requirements are to link to this function and others?
GLIBC is at version 2.13, which is considerably lower than 4.5.21, but the Wikipedia page about glibc says:
In the early 1990s, the developers of the Linux kernel forked glibc. Their fork, called "Linux libc", was maintained separately for years and released versions 2 through 5.
... and
The last used version of Linux libc used the internal name (soname) libc.so.5. Following on from this, glibc 2.x on Linux uses the soname libc.so.6
Does that imply that any glibc is equivalent to a "Linux libc" with a major version higher than 5?
There are other man pages referencing this or that version of "libc", so realpath
is merely one example for problem at large.
Note: the code I am building is not limited to Linux, that's why I need a definite method to detect whether a certain function is available.
glibc, although at version 2.x, was for many years referred to as "libc6" for compatibility with the versioning scheme of the old libc3/4/5. In any case, the man pages on a Linux system are very helpful, but not necessarily canonical. glibc uses the "info" system instead of man pages, thus for glibc functions, you may be better off looking at the glibc manual than the man pages. While the bugs category on the realpath function is interesting in a historical context, unless you're targeting libc5 systems (which, surely you're not) is not particularly helpful.