Resolves path names.
Standard C Library (libc.a)
char *realpath (const char *file_name,
char *resolved_name)
The realpath subroutine performs filename expansion and path name resolution in file_name and stores it in resolved_name.
The realpath subroutine can handle both relative and absolute path names. For both absolute and relative path names, the realpath subroutine returns the resolved absolute path name.
The character pointed to by resolved_name must be big enough to contain the fully resolved path name. The value of PATH_MAX (defined in limits.h header file may be used as an appropriate array size.
On successful completion, the realpath subroutine returns a pointer to the resolved name. Otherwise, it returns a null pointer, and sets errno to indicate the error. If the realpath subroutine encounters an error, the contents of resolved_name are undefined.
Under the following conditions, the realpath subroutine fails and sets errno to:
The realpath subroutine may fail if:
ENOMEM | Insufficient storage space is available. |
The getcwd or sysconf (sysconf Subroutine) subroutine.