Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 1997 11:28:14 +0100 (MET)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hackers@freebsd.org
Cc:        tlambert@primenet.com
Subject:   catching signals...
Message-ID:  <199710121028.LAA03127@labinfo.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
I am having the following problem with the audio driver...

normally, a close() on the audio device will patiently wait for data in
the playout queue to be consumed before returning. However, when a
process using the audio device is aborted with a signal, it would be
probably better to flush the output immediately rather than wait.

The problem is, (1) how do I discriminate among these two situations
in the driver ? Is there any parameter in the call to close() which
allows me to make the distinction ?

Even worse, (2) what do I do when there are multiple references to the same
descriptor, and one is aborted ?

Some time ago it was pointed out that the interface between the kernel
and the device driver does not notify the driver when a reference to
the device is lost, only when it is acquired through open(). So I guess
for (2) there is no hope to be able to do something sensible.

I am wondering, would it be reasonable to define and implement a new
interface in the device driver to notify the driver about processes who
reference them ?

	Thanks
	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



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