Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Aug 1997 09:55:15 -0700 (PDT)
From:      Jim Shankland <jas@flyingfox.com>
To:        luigi@labinfo.iet.unipi.it, msmith@atrad.adelaide.edu.au
Cc:        hackers@FreeBSD.ORG
Subject:   Re: device close behaviour - a question
Message-ID:  <199708011655.JAA03079@biggusdiskus.flyingfox.com>

next in thread | raw e-mail | index | archive | help
[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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708011655.JAA03079>