datamsg(D3)

datamsg - test whether a message is a data message

As shipped in IRIX 6.5.19. Unchanged since IRIX 6.5.

NAME
     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);

   Arguments
     type      The type of message to be tested.

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

   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.

   Level
     Base or Interrupt.

   Synchronization Constraints
     Does not sleep.

     Driver-defined basic locks, read/write locks, and sleep locks may be held
     across calls to this function.

   Examples
     The put(D2) routine enqueues all data messages for handling by the
     srv(D2) (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  }
REFERENCES
     allocb(D3), datab(D4), messages(D5), msgb(D4)