pcmsg(D3)

pcmsg - test whether a message is a priority control message

Showing IRIX 6.5.30 (default release). Unchanged since IRIX 6.5.

NAME
     pcmsg - test whether a message is a priority control message

SYNOPSIS
     #include <sys/types.h>
     #include <sys/stream.h>
     #include <sys/ddi.h>
     int pcmsg(uchar_t type);

   Arguments
     type      The type of message to be tested.

DESCRIPTION
     The pcmsg function tests the type of message to determine if it is a
     priority control message (also known as a high priority message).

   Return Values
     pcmsg returns 1 if the message is a priority control message and 0 if the
     message is any other type.

USAGE
     The db_type field of the datab(D4) 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 service routine processes messages on the queue.  If the message is a
     high priority message, or if it is a normal message and the stream is not
     flow-controlled, the message is processed and passed along in the stream.
     Otherwise, the message is placed back on the head of the queue and the
     service routine returns.

      1    xxxsrv(q)
      2        queue_t *q;
      3    {
      4        mblk_t *mp;
      5        while ((mp = getq(q)) != NULL) {
      6            if (pcmsg(mp->b_datap->db_type) || canputnext(q->g_next)) {
      7                /* process message */
      8                putnext(q, mp);
      9            } else {
     10                putbq(q, mp);
     11                return;
     12            }
     13        }
     14    }

REFERENCES
     allocb(D3), datab(D4), msgb(D4), messages(D5)