1datamsg(9F)              Kernel Functions for Drivers              datamsg(9F)
2
3
4

NAME

6       datamsg - test whether a message is a data message
7

SYNOPSIS

9       #include <sys/stream.h>
10       #include <sys/ddi.h>
11
12
13
14       int datamsg(unsigned char type);
15
16

INTERFACE LEVEL

18       Architecture independent level 1 (DDI/DKI).
19

PARAMETERS

21       type    The  type  of  message  to  be tested. The db_type field of the
22               datab(9S) structure contains the message type. This  field  may
23               be     accessed     through    the    message    block    using
24               mp->b_datap->db_type.
25
26

DESCRIPTION

28       The datamsg() function tests the type of message to determine if it  is
29       a data message type (M_DATA, M_DELAY, M_PROTO , or M_PCPROTO).
30

RETURN VALUES

32       datamsg returns
33
34       1    if the message is a data message
35
36
37       0    otherwise.
38
39

CONTEXT

41       The  datamsg()  function  can be called from user, interrupt, or kernel
42       context.
43

EXAMPLES

45       The put(9E) routine enqueues all data  messages  for  handling  by  the
46       srv(9E)  (service)  routine.  All  non-data messages are handled in the
47       put(9E) routine.
48
49         1 xxxput(q, mp)
50         2      queue_t *q;
51         3      mblk_t *mp;
52         4 {
53         5    if (datamsg(mp->b_datap->db_type)) {
54         6            putq(q, mp);
55         7            return;
56         8    }
57         9    switch (mp->b_datap->db_type) {
58         10    case M_FLUSH:
59                          ...
60         11    }
61         12 }
62
63

SEE ALSO

65       put(9E), srv(9E), allocb(9F), datab(9S), msgb(9S)
66
67
68       Writing Device Drivers
69
70
71       STREAMS Programming Guide
72
73
74
75SunOS 5.11                        16 Jan 2006                      datamsg(9F)
Impressum