[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]
>> Also, when the close is performed, the write queue is flushed and the
>> STREAMs are closed from the driver to stream head (i.e., in the direction
>> of the read queue)
>Are you sure? I've seen the stream dismantled and the closes
>performed in the opposite order from when it was constructed --
>from the stream head down (at least on UnixWare).
The Solaris manual for close(9e) (9e being the section that describes the
entry points of kernel drivers), says:
The close() routines of STREAMS drivers and modules are
called when a stream is dismantled or a module popped. The
steps for dismantling a stream are performed in the follow-
ing order. First, any multiplexor links present are
unlinked and the lower streams are closed. Next, the fol-
lowing steps are performed for each module or driver on the
stream, starting at the head and working toward the tail:
1. The write queue is given a chance to drain.
2. The close() routine is called.
3. The module or driver is removed from the stream.
(On second reading, I might had the order reversed.)
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.