tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

cloning devices and DTYPE_MISC



fd_clone() explicitly sets the type of the cloned file to DTYPE_MISC.
One annoying effect this has is that it makes it hard to look at a process
that has several cloned devices open and see which is which.

It also makes it very hard for pseudodevices which have ioctls that
operate on file descriptors to tell which are "their own" though there
are other means of dealing with that.

To avoid these problems, /dev/crypto used to use its own DTYPE,
DTYPE_CRYPTO.  When the code was converted to use fd_clone() this was
lost.  But I don't think a DTYPE per cloning device is the right way to
go, anyway.

I propose that we add:

        1) One more DTYPE, DTYPE_CLONE which is for descriptors returned by
           cloning device drivers.
        2) a field to struct file to hold the device major and minor numbers
           for such descriptors.
        3) A third argument to fd_clone(), to set the field when cloning
           the descriptor.

-- 
Thor Lancelot Simon
Coyote Point Systems, Inc.                      <tls%coyotepoint.com@localhost>
Millerton, NY, USA


Home | Main Index | Thread Index | Old Index