From owner-freebsd-arch Mon Jan 29 4:31:10 2001 Delivered-To: freebsd-arch@freebsd.org Received: from storm.FreeBSD.org.uk (storm.freebsd.org.uk [194.242.139.170]) by hub.freebsd.org (Postfix) with ESMTP id A53B437B404 for ; Mon, 29 Jan 2001 04:30:50 -0800 (PST) Received: (from brian@localhost) by storm.FreeBSD.org.uk (8.11.1/8.11.1) id f0TCSgP60147; Mon, 29 Jan 2001 12:28:42 GMT (envelope-from brian) Date: Mon, 29 Jan 2001 12:28:42 GMT From: Brian Somers Message-Id: <200101291228.f0TCSgP60147@storm.FreeBSD.org.uk> To: Poul-Henning Kamp Cc: Brian Somers , freebsd-arch@FreeBSD.org Subject: Re: Cloned open support In-Reply-To: Your message of "Mon, 29 Jan 2001 12:43:32 +0100" <20362.980768612@critter> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >2. Given that I'll need to change the d_open prototype (and > > thus cdevsw) > > I'm not sure that is really a good idea. > > If you look at the device name clone stuff I think I have made > it possible to handle it there. > > The idea being that you call it on "/dev/pty" and it will clone > "/dev/pty38" for you and return the dev_t for that. You then > complete the open on that dev_t. I have not quite thought > it through though. > > Either way, I think cloning open should be kept out of d_open > one way or another. The thing is that I believe the driver needs to be able to decide what minor number will be opened. This idea is taken from the Solaris implementation. For example, I have a theoretical driver that does this: o Makes minor 0 available in /dev as a control device o Makes minor 1 available as something that'll be cloned. o The descriptor returned from opening minor 1 may itself me made available via namefs (a vfs that allows you to turn a descriptor into a mountpoint to give other users access to it) and may be opened again. Such descriptors are not cloned. Although this sounds exotic, it's quite practical, and impossible to do outside of the driver. I think deciding on the minor outside the driver is too limiting. > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message