Subject: Re: /proc + Linux emul: "exe" is no symlink
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 10/27/2006 09:45:47
--HcAYCG3uE/tztfnV
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
>=20
> 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.
>=20
> 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=
=20
a path, we will always be able to come up with a path at the moment of=20
exec.

Take care,

Bill

--HcAYCG3uE/tztfnV
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)

iD8DBQFFQje7Wz+3JHUci9cRAhLFAJ9D0bzzWAd9At+JpqQccOYnoZ3xhgCfQ0mI
ObEDdfZeu/qnuZdwzHhVKpY=
=fl+G
-----END PGP SIGNATURE-----

--HcAYCG3uE/tztfnV--