From owner-freebsd-hackers Sun Oct 12 04:46:38 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA15811 for hackers-outgoing; Sun, 12 Oct 1997 04:46:38 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id EAA15806 for ; Sun, 12 Oct 1997 04:46:32 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id LAA03127; Sun, 12 Oct 1997 11:28:14 +0100 From: Luigi Rizzo Message-Id: <199710121028.LAA03127@labinfo.iet.unipi.it> Subject: catching signals... To: hackers@freebsd.org Date: Sun, 12 Oct 1997 11:28:14 +0100 (MET) Cc: tlambert@primenet.com X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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/ _____________________________|______________________________________