flush_exempt - exempt queued data messages from future flush operations
# include <sys/stream.h> void flush_exempt(queue_t *q);
Pointer to the queue
Architecture independent level 1 (DDI/DKI).
The flush_exempt() function exempts M_DATA messages on a queue from subsequent flush operations.
The flush_exempt() function sets the DBLK_FLUSHEXEMPT flag in the db_flag field of data blocks associated with the messages. This prevents any subsequent calls to the flushq() from freeing the messages. For more information, see the flushq(9F) man page.
The flush_exempt() function can be called from user, interrupt, or kernel context.
This example illustrates the use of the flush_exempt() function to ensure any previously written output which has been queued will not be freed following a tcsetattr() call. The M_FLUSHEXEMPT message would typically be sent by ptem in response to a TCSETSF or TCSETSW ioctl generated by the tcsetattr(). For more information, see the tcsetattr(3C) and ptem(4M) man pages.
/* * Module write-side put procedure. */ xxxwput(q, mp) queue_t *q; mblk_t *mp; unsigned char type = mp->b_datap->db_type; switch (type) { case M_FLUSHEXEMPT: /* * Protect any queued data messages from a future flush. */ flush_exempt(qp); break;