Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pcmsg(D3) — UnixWare 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought






       pcmsg(D3)                                                  pcmsg(D3)


       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    {


                           Copyright 1994 Novell, Inc.               Page 1













      pcmsg(D3)                                                  pcmsg(D3)


             4          mblk_t *mp;
             5          while ((mp = getq(q)) != NULL) {
             6                if (pcmsg(mp->b_datap->db_type) || canputnext(q)) {
             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)

      NOTICES
         Portability
            All processors

         Applicability
            ddi: 3, 5, 5mp, 6, 6mp, 7, 7mp



























                          Copyright 1994 Novell, Inc.               Page 2








Typewritten Software • bear@typewritten.org • Edmonds, WA 98026