STREAMS-UX Programmer's Guide (February 2007)
Multiplexing
STREAMS Multiplexor
Chapter 5
132
case D_IOCTL2:
...
/* ioctl commands not recognized by the driver */
default:
/* Send a negative acknowledgement upstream */
mp->b_datap->db_type = M_IOCNAK;
qreply(q, mp);
break;
}
break;
case M_FLUSH:
if (*mp->b_rptr & FLUSHW) {
/* Flush the write queue */
...
}
if (*mp->b_rptr & FLUSHR) {
*mp->b_rptr &= ~FLUSHW;
/* Flush the read queue if messages can be enqueued */
...
qreply(q, mp);
} else
freemsg(mp);
break;
default:
freemsg(mp);
break;
} /* end switch */
return;
}