From owner-freebsd-hackers Fri Aug 1 09:57:18 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA29103 for hackers-outgoing; Fri, 1 Aug 1997 09:57:18 -0700 (PDT) Received: from biggusdiskus.flyingfox.com (biggusdiskus.flyingfox.com [206.14.52.27]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA29095 for ; Fri, 1 Aug 1997 09:57:15 -0700 (PDT) Received: (from jas@localhost) by biggusdiskus.flyingfox.com (8.8.5/8.8.5) id JAA03079; Fri, 1 Aug 1997 09:55:15 -0700 (PDT) Date: Fri, 1 Aug 1997 09:55:15 -0700 (PDT) From: Jim Shankland Message-Id: <199708011655.JAA03079@biggusdiskus.flyingfox.com> To: luigi@labinfo.iet.unipi.it, msmith@atrad.adelaide.edu.au Subject: Re: device close behaviour - a question Cc: hackers@FreeBSD.ORG 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 then iterate over the devices, until an open() call does not return EBUSY (just like looking for an available pty). Since each "device" is open at most once, the device_close() routine gets called on every user-level close() call. Hope this is useful. Jim Shankland Flying Fox Computer Systems, Inc.