|
|
#include <sys/types.h> #include <sys/stream.h> #include <sys/ddi.h>int pcmsg(uchar_t type);
db_type
field of the
datab(D4str)
structure
contains the message type.
This field may be accessed through the message block using
mp->b_datap->db_type
.
Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.
The service routine processes messages on the queue. If the message is a high priority message, or if it is a normal message and the stream is not flow-controlled, the message is processed and passed along in the stream. Otherwise, the message is placed back on the head of the queue and the service routine returns.
1 xxxsrv(q) 2 queue_t *q; 3 { 4 mblk_t *mp;5 while ((mp = getq(q)) != NULL) { 6 if (pcmsg(mp->b_datap->db_type) || canputnext(q)) { 7 /* process message */ 8 putnext(q, mp); 9 } else { 10 putbq(q, mp); 11 return; 12 } 13 } 14 }