descriptors vs pathnames (was Re: getcwd() and friends.)

Greg Noel greg at ncr-sd.SanDiego.NCR.COM
Thu Apr 13 15:59:23 AEST 1989


In article <4457 at psuvax1.cs.psu.edu> schwartz at shire.cs.psu.edu
(Scott Schwartz) writes:
>... what Felix Lee and I are proposing ... is to add two new flags
>to open....  The flags are O_EXEC ... and O_OPEN ....

It's interesting to me how this thread is re-inventing the opaque directory
object proposed as part of the Secure Multics Project.  The essential point
of your proposal is to be able to acquire a handle on some component of the
file system tree, and then be able to perform operations on it.  In other
words, you are decoupling the name lookup from the operation.  The points
you are mooting have to do with the semantics of name lookup; you should
focus your effor there.

So what you need is a syscall that allows you to convert a textual name
into an opaque file handle; for the sake of discussion (no matter how it's
actually implemented), let's call it namei().  Thus, namei("/usr/tmp/foo")
produces a file handle for a (potentially non-existant?) file; then most
of the current system call that take a name could be defined in terms of this
new call.  (creat(filename, mode) would be fcreate(namei(filename, mode)).)
The new syscalls should modify the file handle passed it, not create a new
one, so the standard sematics can be easily simulated.

I don't think you need more than the one new syscall (or one new option to
the current open) in order to get the results you want; just consider the
file handle as opaque until it's consumed by another syscall, which has the
power to modify the attributes as necessary.
-- 
-- Greg Noel, NCR Rancho Bernardo   Greg.Noel at SanDiego.NCR.COM  or  greg at ncr-sd



More information about the Comp.unix.wizards mailing list