Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

flush_exempt (9F)

Name

flush_exempt - exempt queued data messages from future flush operations

Synopsis

# include <sys/stream.h>
void flush_exempt(queue_t *q);

Parameters

q

Pointer to the queue

Interface Level

Architecture independent level 1 (DDI/DKI).

Description

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.

Context

The flush_exempt() function can be called from user, interrupt, or kernel context.

Examples

Example 1 Using flush_exempt() Function

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;

See Also

flushq(9F), tcsetattr(3C), ptem(4M)

STREAMS Programming Guide