Query: qreply
OS: linux
Section: 9f
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
qreply(9F) Kernel Functions for Drivers qreply(9F)NAMEqreply - send a message on a stream in the reverse directionSYNOPSIS#include <sys/stream.h> void qreply(queue_t *q, mblk_t *mp);INTERFACE LEVELArchitecture independent level 1 (DDI/DKI).PARAMETERSq Pointer to the queue. mp Pointer to the message to be sent in the opposite direction.DESCRIPTIONqreply() sends messages in the reverse direction of normal flow. That is, qreply(q, mp) is equivalent to putnext(OTHERQ(q), mp).CONTEXTqreply() can be called from user or interrupt context.EXAMPLESExample 1: Canonical Flushing Code for STREAMS Drivers. This example depicts the canonical flushing code for STREAMS drivers. Assume that the driver has service procedures so that there may be messages on its queues. See srv(9E). Its write-side put procedure handles M_FLUSH messages by first checking the FLUSHW bit in the first byte of the message, then the write queue is flushed (line 8) and the FLUSHW bit is turned off (line 9). See put(9E). If the FLUSHR bit is on, then the read queue is flushed (line 12) and the message is sent back up the read side of the stream with the qre- ply(9F) function (line 13). If the FLUSHR bit is off, then the message is freed (line 15). See the example for flushq(9F) for the canoni- cal flushing code for modules. 1 xxxwput(q, mp) 2 queue_t *q; 3 mblk_t *mp; 4 { 5 switch(mp->b_datap->db_type) { 6 case M_FLUSH: 7 if (*mp->b_rptr & FLUSHW) { 8 flushq(q, FLUSHALL); 9 *mp->b_rptr &= ~FLUSHW; 10 } 11 if (*mp->b_rptr & FLUSHR) { 12 flushq(RD(q), FLUSHALL); 13 qreply(q, mp); 14 } else { 15 freemsg(mp); 16 } 17 break; . . . 18 } 19 }SEE ALSOput(9E), srv(9E), flushq(9F), OTHERQ(9F), putnext(9F) Writing Device Drivers STREAMS Programming Guide SunOS 5.10 11 Apr 1991 qreply(9F)
Related Man Pages |
---|
qreply(9f) - debian |
qreply(9f) - centos |
qreply(9f) - php |
qreply(9f) - xfree86 |
qreply(9f) - plan9 |
Similar Topics in the Unix Linux Community |
---|
Forum Video Tutorial: How to Use Code Tags |
Scripts without shebang |
Merry Christmas! |
YouTube: How to Use Code Tags and Format Posts @UNIX.com |