Subject: re: Pathname translation for emulations (Was: Re: Removing compat/aout)
To: matthew green <mrg@eterna.com.au>
From: Todd Vierling <tv@wasabisystems.com>
List: tech-kern
Date: 03/08/2002 22:06:16
On Sat, 9 Mar 2002, matthew green wrote:

:    Then that's a bug.  Translation should be applied uniformly to a uniform set
:    of syscalls.  (IMNSHO, it should be all syscalls which take a filename in
:    the filesystem namespace.)

Actually, I misspoke here; I meant to say all syscalls that take an absolute
pathname to something preexisting, that's opened for IO (see below).

: i don't agree.  particularly, any system call that creates anything
: should never have path translation.  that way leads to hell.

I believe (memory only; I'd need to go search for my old comments) that the
ideal situation is to have only open() (if the vnode preexists) or
getdents(), on an absolute path, require path translation, and little or no
more.  This would remove the problems we've seen without causing more.

There might be some small exceptions to this:  chdir() might warrant a
translation *after* it's known that the path rooted at / does not exist (to
allow an application to find its files in /emul/linux/usr/foo/etc, for
instance).  However, this is not an issue related to the binary format or
emulated OS, and can and should be applied uniformly.

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi & NetBSD:  Run with it.
-- CDs, Integration, Embedding, Support -- http://www.wasabisystems.com/