#include <stdlib.h> #include <sys/param.h>
char *realpath(char *file_name, char *resolved_name);
MT-Safe
It can handle both relative and absolute path names. For absolute path names and the relative names whose resolved name cannot be expressed relatively (for example, ../../reldir), it returns the resolved absolute name. For the other relative path names, it returns the resolved relative name.
resolved_name must be big enough (MAXPATHLEN ) to contain the fully resolved path name.
One should have execute permission on all the directories in the given and the resolved path.
realpath() may fail to return to the current directory if an error occurs.