From owner-freebsd-hackers Fri Aug 1 16:09:53 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id QAA17571 for hackers-outgoing; Fri, 1 Aug 1997 16:09:53 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id QAA17563 for ; Fri, 1 Aug 1997 16:09:46 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id OAA09757; Fri, 1 Aug 1997 14:46:52 -0700 From: Terry Lambert Message-Id: <199708012146.OAA09757@phaeton.artisoft.com> Subject: Re: device close behaviour - a question To: hasty@rah.star-gate.com (Amancio Hasty) Date: Fri, 1 Aug 1997 14:46:52 -0700 (MST) Cc: terry@lambert.org, msmith@atrad.adelaide.edu.au, luigi@labinfo.iet.unipi.it, hackers@FreeBSD.ORG In-Reply-To: <199708011923.MAA05657@rah.star-gate.com> from "Amancio Hasty" at Aug 1, 97 12:23:48 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Curious, shouldn't the responsibility of managing the behavior of > open/close fall on the device driver . After all the driver should > dictate whether it can manage multiple open instances. As for determining > whether there are multiple opens on a device we can create an ioctl > which returns the number of opens . Ideally, it should return instances > of the states for each open. The problem is that there is not an addref entry point for drivers. Specifically, when a process fork()'s, the new fd's are fd references to the same vnode, and an open is not called, and an "addref" that would add a reference instance is not called. One can not treat this reference creation as if it were an open, and call the open entry point. For one thing, there might be an implied exclusive use. For another, the open may not result in an identical descriptor... consider an open that completed because some condition (which is no longer true) was met. There needs to be a seperation of open instances from reference instances, and that's ll there is to it. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.