From owner-freebsd-hackers Sat Aug 2 16:00:10 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id QAA20214 for hackers-outgoing; Sat, 2 Aug 1997 16:00:10 -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 QAA20209 for ; Sat, 2 Aug 1997 16:00:05 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id PAA00412; Sat, 2 Aug 1997 15:58:11 -0700 From: Terry Lambert Message-Id: <199708022258.PAA00412@phaeton.artisoft.com> Subject: Re: device close behaviour - a question To: msmith@atrad.adelaide.edu.au (Michael Smith) Date: Sat, 2 Aug 1997 15:58:10 -0700 (MST) Cc: jas@flyingfox.com, luigi@labinfo.iet.unipi.it, msmith@atrad.adelaide.edu.au, hackers@FreeBSD.ORG In-Reply-To: <199708020252.MAA08782@genesis.atrad.adelaide.edu.au> from "Michael Smith" at Aug 2, 97 12:22:18 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 > > [Luigi Rizzo would like his audio driver to be notified every time > > the device is closed, not just on last close.] > > > > The way I've dealt with a similar situation in the past is to represent > > each physical device as an array of minor device numbers, on each of > > which the driver enforces an exclusive-open. User-level code must > > The point I am trying to make here is that you _cannot_ enforce an > exclusive open, because the devic driver is not notified under all of > the circumstances which result in a new fd being granted. This was kinda my point as well on the "addref" response. Really, there is a need for this notification to happen in all cases. Really, the only issues are dup, dup2 (a special case of dup), fork, close on exec, and descriptor passing (this last is not really an issue, IMO -- I think it falls into the dup case). I'm 100% behind Poul on this one... Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.