realpath - returns the canonicalized absolute pathname.
char *realpath(char *path, char resolved_path);
realpath expands all symbolic links and resolves references
to '/./', '/../' and extra '/' characters in the null ter-
minated string named by path and stores the canonicalized
absolute pathname in the buffer of size MAXPATHLEN named by
resolved_path. The resulting path will have no symbolic
link, '/./' or '/../' components.
If there is no error, it returns a pointer to the
Otherwise it returns a NULL pointer and places in
resolved_path the absolute pathname of the path component
which could not be resolved. The global variable errno is
set to indicate the error.
ENOTDIR A component of the path prefix is not a directory.
EINVAL The pathname contains a character with the high-
order bit set.
A component of a pathname exceeded MAXNAMLEN charac-
ters, or an entire path name exceeded MAXPATHLEN
ENOENT The named file does not exist.
EACCES Search permission is denied for a component of the
ELOOP Too many symbolic links were encountered in
translating the pathname.
EIO An I/O error occurred while reading from the file