SVR5 and SCO OpenServer 5
datamsg(D3str)
datamsg --
test whether a message is a data message
Synopsis
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/ddi.h>
int datamsg(uchar_t type);
Description
The datamsg function tests
the type of message to determine
if it is a data message type:
M_DATA(D7str),
M_DELAY(D7str),
M_PROTO(D7str),
or
M_PCPROTO(D7str).
Arguments
type-
The type of message to be tested.
Return values
datamsg returns 1 if the message is a data message
and 0 if the message is any other type.
Usage
The db_type
field of the datab structure
contains the message type.
This field may be accessed through the message block using
mp->b_datap->db_type
.
Context
Base or Interrupt.
Synchronization constraints
Does not block.
Driver-defined basic locks, read/write locks, and sleep locks
may be held across calls to this function.
Examples
The
put(D2str)
routine enqueues all data messages for handling
by the
srv(D2str)
service routine.
All non-data messages are
handled in the put routine.
1 xxxput(q, mp)
2 queue_t *q;
3 mblk_t *mp;
4 {
5 if (datamsg(mp->b_datap->db_type)) {
6 putq(q, mp);
7 return;
8 }
9 switch (mp->b_datap->db_type) {
10 case M_FLUSH:
...
11 }
12 }
Hardware applicability
All
Version applicability
ddi:
1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
oddi:
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp
Differences between versions
In ODDI version 3 and later versions,
datamsg
is implemented as a macro.
The syntax is the same.
References
allocb(D3str),
datab(D4str),
Intro(D7str),
msgb(D4str)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005