Subject: Re: /proc + Linux emul: "exe" is no symlink
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Bill Studenmund <email@example.com>
Date: 10/27/2006 09:45:47
Content-Type: text/plain; charset=us-ascii
On Thu, Oct 26, 2006 at 11:55:16AM -0400, der Mouse wrote:
> >>> It's bogus -- it requires a vnode-to-name translation that is not
> >>> always possible, and, when it is, requires the storage of a great
> >>> deal of extra information in a frequently accessed datastructure in
> >>> the kernel.
> >> Howzabout just saving the last-execed pathname?
> > That is essentially what the namei cache does - the last-used path
> > name to get to a given vnode.
> Yes, but (at least as I understand it) it (a) is indexed the other way
> (name->vnode), (b) *is* a cache and as such can discard entries
> whenever it feels like it, (c) stores only components, and as such
> won't give you a path without walking up the directory tree to get a
> whole pathname, and (d) is good only for current paths - it can't give
> you the sort of "it used to be here but it's not any longer" semantics
> Linux seems to have.
> I was suggesting that exec() include something conceptually like
> "proc->p_last_exec_path =3D strdup(pathname);".
I agree. I was skimming this thread, and came to the same conclusion.=20
Since exec happens via the execve(2) system call which in turn only takes=
a path, we will always be able to come up with a path at the moment of=20
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)
-----END PGP SIGNATURE-----