On Mon, 10 Jun 2002, Maksim Yevmenkin wrote:
MY>The project i'm working on might require some sort of
MY>device cloning. The current way of cloning, i.e. use
MY>DEVFS and allocate unique minor numbers, is not very
MY>good for my purpose.
MY>The idea is simple: the same device(major,minor) can
MY>be opened several times by different processes (or
MY>possibly threads within the same process) and each
MY>process (thread) will have unique device instance.
MY>Device driver will create new instance, every time
MY>open() called. It will use D_TRACKCLOSE flag and
MY>destroy instances in close().
MY>What kind of information should i store to identify
MY>each instance? Is/Will it be possible to identify a
MY>single thread within a process? Is there any problems
MY>with fork()? The support for the threads is optional.
MY>I can live with single instance per process.
In MHO this idea is based on a fundamental misunderstanding of what a
device is under unix. If you need such a behaviour you should put another
abstraction on top of you devices (as the filesystem is put on top of
disks and sockets on top of network devices), that handle multiple
contexts for multiple processes. A device is just a device...
harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message