Say I have a program, abc in Linux, with a method:
char *currentPath(){
        char *path=NULL;
        path = getcwd(path, MAXPATHLEN);
        return path;
}
When calling abc directly, this path returns the path that abc is in.
If I make a symbolic link to abc, and call the symbolic link, currentPath() returns the path of the symbolic link.
Is there a way to get make this method return the path of abc? I am interested in accessing files relative to the location of abc.
 
     
     
    