[TUHS] Also, relative to absolute pathnames?

Clem Cole via TUHS tuhs at tuhs.org
Sat Jun 27 01:36:26 AEST 2026


The POSIX-defined function

char *realpath(const char *restrict *file_name*,
       char *restrict *resolved_name*);


See: https://pubs.opengroup.org/onlinepubs/009696799/functions/realpath.html

The sources and man page for the BSD implementation can be found in Disk3
of Kirk's CD in the 4.4BSD-Lite1/usr/src/lib/libc/stdlib/ and on Disk4
in lib/libc/gen/
which also includes the SCCS file

Although grep(1) reports that only its man page was included in 4.4BSD-Lite2

I will note that on a POSIX-conforming system, it must be included and
defined in the stdlib.h
But it should also be remembered that none of the C standards, including
the current C23 standard, require it.

I believe gcc includes a version in its runtime library, but I'm not sure
about LLVM's clang, although I would be mildly surprised if it wasn't.


More information about the TUHS mailing list