Skip site navigation (1)Skip section navigation (2)
Date:      11 Jun 2002 15:49:28 +0930
From:      "Daniel O'Connor" <doconnor@gsoft.com.au>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Maksim Yevmenkin <m_evmenkin@yahoo.com>, current@FreeBSD.ORG
Subject:   Re: Device cloning
Message-ID:  <1023776371.2412.455.camel@chowder.gsoft.com.au>
In-Reply-To: <29346.1023743719@critter.freebsd.dk>
References:  <29346.1023743719@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2002-06-11 at 06:45, Poul-Henning Kamp wrote:
> >The idea is simple: the same device(major,minor) can
> >be opened several times by different processes (or
> >possibly threads within the same process) and each
> >process (thread) will have unique device instance. 
> 
> Sorry, but this wont work for a large number of reasons.
> 
> For one thing none of the  dup(2) or fork(2) like systemcalls
> report what happens to the filedescriptors down to the
> device drivers so you have no way to correctly track which
> process or which instance you are working on.

Can't you kludge this by creating /dev/foo0 and when it is opened
replacing it with a different minor number?

Or perhaps /dev/foo0 as a symlink to /dev/foo0.0 and when it is opened
create /dev/foo0.1 and change the symlink.

This is obviously a different major,minor pair but those are the
constraints in the system :)

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 9A8C 569F 685A D928 5140  AE4B 319B 41F4 5D17 FDD5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1023776371.2412.455.camel>