|
|
1.1 root 1: /*++
2:
3: Copyright (c) 1991 Microsoft Corporation
4:
5: Module Name:
6:
7: in_rsrv.c
8:
9: Abstract:
10:
11: This source file contains the read 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: insrsrv(
24: IN queue_t *rq
25: )
26:
27: /*++
28:
29: Routine Description:
30:
31: This is the read service procedure of the insulating STREAMS module.
32:
33: It is based on the example on Unix SVR4 Programmers' Guide: STREAMS
34: (page 8-7).
35:
36: Arguments:
37:
38: rq - queue whose service procedure is being run.
39:
40: Return Value:
41:
42: the constant 1. STREAMS does not specify what the return values
43: from put and service procedures should be.
44:
45: --*/
46:
47: {
48: mblk_t *mp;
49:
50: while (mp = getq(rq)) {
51:
52: switch (mp->b_datap->db_type) {
53: case M_FLUSH:
54: if (*(mp->b_rptr) & FLUSHR) {
55: flushq(rq, FLUSHDATA);
56: }
57: putnext(rq, mp);
58: return(1);
59:
60: //
61: // high-priority messages are not subject to flow-control.
62: //
63: default:
64: if ((mp->b_datap->db_type >= QPCTL) ||
65: canput(rq->q_next)) {
66: putnext(rq, mp);
67: continue;
68: }
69: putbq(rq, mp);
70: return(1);
71: }
72: }
73: return(1);
74:
75: } // insrsrv
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.