From owner-freebsd-current Fri Jan 12 16:16: 1 2001 Delivered-To: freebsd-current@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 49E9537B401; Fri, 12 Jan 2001 16:15:44 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f0D0Fb209446; Fri, 12 Jan 2001 16:15:37 -0800 (PST) Date: Fri, 12 Jan 2001 16:15:37 -0800 From: Alfred Perlstein To: Andrew Gallatin Cc: Julian Elischer , phk@FreeBSD.ORG, freebsd-current@FreeBSD.ORG Subject: Re: Running Linux kernel modules. Message-ID: <20010112161535.B7240@fw.wintelcom.net> References: <01C07BF3.695D3780.ggross@symark.com> <14942.32188.899333.434988@grasshopper.cs.duke.edu> <3A5F16D8.2E1B471C@elischer.org> <14943.37198.480690.136547@grasshopper.cs.duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <14943.37198.480690.136547@grasshopper.cs.duke.edu>; from gallatin@cs.duke.edu on Fri, Jan 12, 2001 at 06:28:34PM -0500 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Andrew Gallatin [010112 15:29] wrote: > > Julian Elischer writes: > > > > > > Isn't this gross? Is there a better way? > > > > I think that the better way is to actually have each open have a > > different minor number. > > i.e. each process opens a different copy. > > > The way to achieve this best is with cloning devices. > > apply within phk for more info :-) > > Does this mean that the processes can open /dev/foo0 twice and the > driver sees a different minor number for each open? Or does it mean > that the process has to open /dev/foo0 and /dev/foo1? > > If the former, that's awesome!... How do I use it? Well you have to write it, but you basically have the open(2) syscall path optionally return a seperate void * 'cookie' that you must pass into all operations (fileops) on that file. It's not a major rewrite of any code, you just need an extra parameter per fileop and store it in the struct file. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message