|
|
1.1 ! root 1: /*++ ! 2: ! 3: Copyright (c) 1991 Microsoft Corporation ! 4: ! 5: Module Name: ! 6: ! 7: in_wsrv.c ! 8: ! 9: Abstract: ! 10: ! 11: This source file contains the write service procedure that is used by ! 12: the insulating modules. ! 13: ! 14: --*/ ! 15: ! 16: #include "insulate.h" ! 17: ! 18: ! 19: ! 20: ! 21: ! 22: int ! 23: inswsrv( ! 24: IN queue_t *wq ! 25: ) ! 26: ! 27: /*++ ! 28: ! 29: Routine Description: ! 30: ! 31: This is a write service procedure that simply dequeues and passes ! 32: messages to the next downstream STREAMS module/driver, subject to ! 33: normal flow-control convention. ! 34: ! 35: It is based on the example in Unix SVR4 Programmers' Guide: STREAMS ! 36: (page 8-7). ! 37: ! 38: Arguments: ! 39: ! 40: wq - queue whose service procedure is being run. ! 41: ! 42: Return Value: ! 43: ! 44: the constant 1. STREAMS does not specify what the return values ! 45: from put and service procedures should be. ! 46: ! 47: --*/ ! 48: ! 49: { ! 50: mblk_t *mp; ! 51: ! 52: while (mp = getq(wq)) { ! 53: ! 54: switch (mp->b_datap->db_type) { ! 55: case M_FLUSH: ! 56: if (*(mp->b_rptr) & FLUSHW) { ! 57: flushq(wq, FLUSHDATA); ! 58: } ! 59: putnext(wq, mp); ! 60: return(1); ! 61: ! 62: // ! 63: // high-priority messages are not subject to flow-control. ! 64: // ! 65: default: ! 66: if ((mp->b_datap->db_type >= QPCTL) || ! 67: canput(wq->q_next)) { ! 68: putnext(wq, mp); ! 69: continue; ! 70: } ! 71: putbq(wq, mp); ! 72: return(1); ! 73: } ! 74: } ! 75: return(1); ! 76: ! 77: } // inswsrv
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.