tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: $ORIGIN (was: Re: make: ensure ${.MAKE} works)



On Wed, Apr 21, 2010 at 05:40:57AM +0000, David Holland wrote:
> On Thu, Apr 15, 2010 at 08:40:19AM +0000, David Holland wrote:
>  >> Wish we had working $ORIGIN...
>  > 
>  > We will fairly soon, I think... :-)
> 
> To wit: as far as I can tell, having been wading around in that code
> recently, the only problem with what we have is that if the path sent
> back by namei isn't absolute it needs a getcwd() stuck on the front of
> it.
> 
> Is it reasonable to just do that? I don't think calling getcwd() from
> exec is going to cause locking problems, but it might be more overhead
> than we want to swallow.

Why not get the kernel to keep a reference to the vnode of the
directory that contained the process image?

Then use some flag to open() (or similar) to open a file relative
to that vnode?

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index