DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5 and SCO OpenServer 5

M_FLUSH(D7str)


M_FLUSH -- flush all message queues

Description

This message type requests all modules and drivers that receive it to flush their message queues (discard all messages in those queues) as indicated in the message. All modules that enqueue messages must identify and process this message type.

An M_FLUSH can originate at the Stream head or in any module or driver. The first byte of the message contains flags that specify one of the following actions:


FLUSHR
flush the read queue of the module.

FLUSHW
flush the write queue of the module.

FLUSHRW
flush both the read and the write queue of the module.

FLUSHBAND
flush the message according to the priority associated with the band.
Each module passes this message to its neighbor after flushing its appropriate queue(s) until the message reaches one of the ends of the Stream.

Drivers are expected to include the following processing for M_FLUSH messages: when an M_FLUSH message is sent downstream through the write queues in a Stream, the driver at the Stream end discards it if the message action indicates that the read queues in the Stream are not to be flushed (only FLUSHW set). If the message indicates that the read queues are to be flushed, the driver sets the M_FLUSH message flag to FLUSHR and then sends the message up the Stream's read queues. When a flush message is sent up a Stream's read side, the Stream head checks to see if the write side of the Stream is to be flushed. If only FLUSHR is set, the Stream head discards the message. However, if the write side of the Stream is to be flushed, the Stream head sets the M_FLUSH flag to FLUSHW and sends the message down the Stream's write side.

If FLUSHBAND is set, the second byte of the message contains the value of the priority band to flush. Call flushband(D3str) instead of flushq(D3str) when FLUSHBAND is set. flushband( ) contains an additional second argument that matches the second byte of the message and indicates the band to flush. This flag should be used only for modules that need to process priority banded messages correctly; for most STREAMS drivers and modules, flushing the entire queue is sufficient.

Message type

Priority.

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp

References

flushband(D3str), flushq(D3str), streamio
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005