Subject: Re: dev/audiobell.c proposal
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 01/15/2004 16:59:02
> FreeBSD has a flag in the devsw structure to allow the close function
> to be called at each close call on the device.

> Couldn't we do that, too, either adding a field at the end of struct
> {c,b}devsw or using a special value for d_type?

Probably, but would it do what you want?  It's entirely possible to
have multiple closes for a single open; consider a process that forks.

Unless you call close once per open file table entry rather than once
per descriptor.  I would expect that be very hard to define the
semantics of, short of resorting to describing the kernel internals in
question.  It also amounts to cloning devices, as I understand them,
only more difficult for the driver to deal with.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B