Subject: Re: /proc + Linux emul: "exe" is no symlink
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Date: 10/26/2006 11:55:16
>>> 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 = strdup(pathname);".
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML email@example.com
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B