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

flushq(D3str)


flushq -- flush messages on a queue

Synopsis

   #include <sys/stream.h>
   #include <sys/ddi.h>
   

void flushq(queue_t *q, int flag);

Description

flushq frees messages on a queue by calling freemsg(D3str) for each message. If the queue's count falls below the low water mark and someone wants to write to the queue, the nearest upstream or downstream service procedure is enabled.

Arguments


q
Pointer to the queue to be flushed.

flag
Determines messages to flush. Valid values are:


FLUSHDATA
Flush only data messages.

FLUSHALL
Flush all messages.

Return values

None

Usage

The data message types that are flushed when FLUSHDATA is specified are: M_DATA(D7str), M_DELAY(D7str), M_PROTO(D7str), and M_PCPROTO(D7str).

Context

Base or Interrupt.

Synchronization constraints

Does not block.

Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.

For DDI drivers, the caller cannot have the stream frozen (see freezestr(D3str)) when calling this function.

Examples

See put(D2str) for an example of flushq.

Hardware applicability

All

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, 6, 6mp

References

flushband(D3str), freemsg(D3str), put(D2str), putq(D3str), queue(D4str)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005