DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

pcmsg(D3str)


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

Synopsis (Not in ODDI)

   #include <sys/types.h>
   #include <sys/stream.h>
   #include <sys/ddi.h>
   

int pcmsg(uchar_t type);

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).

Arguments


type
The type of message to be tested.

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(D4str) 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.

Hardware applicability

All

Version applicability

ddi: 3, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

References

allocb(D3str), datab(D4str), msgb(D4str), Intro(D7str)

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)) { 7 /* process message */ 8 putnext(q, mp); 9 } else { 10 putbq(q, mp); 11 return; 12 } 13 } 14 }


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005