Subject: Re: make: absolute path for Makefile in errors.
To: Andrew Brown <atatat@atatdot.net>
From: Ignatios Souvatzis <is@beverly.kleinbus.org>
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.
>
> well...it 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.
Regards,
-is
NAME
realpath - returns the canonicalized absolute pathname
LIBRARY
Standard C Library (libc, -lc)
PSIS
#include <sys/param.h>
#include <stdlib.h>
char *
realpath(const char *pathname, char resolvedname[MAXPATHLEN]);
DESCRIPTION
The realpath() function resolves all symbolic links, extra ``/'' charac-
...