From owner-freebsd-current Mon Jun 10 23:19:46 2002 Delivered-To: freebsd-current@freebsd.org Received: from cain.gsoft.com.au (genesi.lnk.telstra.net [139.130.136.161]) by hub.freebsd.org (Postfix) with ESMTP id 7576F37B401 for ; Mon, 10 Jun 2002 23:19:41 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by cain.gsoft.com.au (8.12.4/8.12.3) with ESMTP id g5B6JSxw008638; Tue, 11 Jun 2002 15:49:30 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Subject: Re: Device cloning From: "Daniel O'Connor" To: Poul-Henning Kamp Cc: Maksim Yevmenkin , current@FreeBSD.ORG In-Reply-To: <29346.1023743719@critter.freebsd.dk> References: <29346.1023743719@critter.freebsd.dk> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 11 Jun 2002 15:49:28 +0930 Message-Id: <1023776371.2412.455.camel@chowder.gsoft.com.au> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.6 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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