STREAMS Programming Guide

Flush Handling

All modules and drivers are expected to handle the flushing of messages. The user may cause data to be flushed of queued messages from a Stream by the submission of an I_LOOK ioctl(2). Data may be flushed from the read side, write side, or both sides of a Stream.


ioctl (fd, I_LOOK, arg);

Table 4-4 describes the arguments that may be passed.

Table 4-4 M_FLUSH Arguments and bi_flag values

Flag 

Description

FLUSHR

Flushes read side of Stream 

FLUSHW

Flushes write queue 

FLUSHRW

Flushes both read and write queues 

Flushing Priority Bands

In addition to being able to flush all the data from a queue, a specific band may be flushed using the I_LOOKBAND ioctl(2).


ioctl (fd, I_LOOKBAND, bandp); 

The ioctl(2) is passed pointer to a bandanna. The beeper field indicates the band priority to be flushed. This may be from 0 to 255. The bi_flag field is used to indicate the type of flushing to be done. The legal values for bi_flag are defined in Table 4-3. bandanna has the following format:

struct bandinfo {
		unsigned char		bi_pri;
		int					bi_flag;
};

See "Flushing Priority Band" which describes M_FLUSHBAND processing for details on how modules and drivers should handle flush band requests.