Subject: Re: make: absolute path for Makefile in errors.
To: Andrew Brown <>
From: Ignatios Souvatzis <>
List: tech-toolchain
Date: 01/04/2001 20:15:25
On Thu, Jan 04, 2001 at 12:57:20AM -0500, Andrew Brown wrote:
> >   sort of...yeah.  did you give any thought to collapsing stuff like
> >   
> >      /usr/src/foo/bar/fork/knife/spoon/../../../Makefile
> >   
> >   to 
> >   
> >      /usr/Makefile
> >
> >you can't really do that.  you don't know where you'll really end up
> >after the ..'s, due to symlinks.
> would be a lot more work, but it *could* be done.

We have a function to do that somewhere. mount calls it. Whatsitsname...

anyway, the failure mode in mount that teached me about it is when I'm su
root, in my NFS-mounted root, thats maproot=nobody...ah, now I remember:
"realpath". See below.


     realpath - returns the canonicalized absolute pathname

     Standard C Library (libc, -lc)
     #include <sys/param.h>
     #include <stdlib.h>

     char *
     realpath(const char *pathname, char resolvedname[MAXPATHLEN]);

     The realpath() function resolves all symbolic links, extra ``/'' charac-