MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Kernel Functions for Drivers                            putbq(9F)



NAME
     putbq - place a message at the head of a queue

SYNOPSIS
     #include 



     int putbq(queuet *q, mblkt *bp);


INTERFACE LEVEL
     Architecture independent level 1 (DI/DKI).

PARAMETERS
     q     Pointer to the queue.


     bp    Pointer to the message block.


DESCRIPTION
     The putbq() function places a message at  the  beginning  of
     the  appropriate  section  of  the  message queue. There are
     always sections for high priority and ordinary messages.  If
     other  priority  bands are used, each will have its own sec-
     tion of the queue, in priority band order, after high prior-
     ity  messages  and  before ordinary messages. putbq() can be
     used for ordinary, priority band,  and  high  priority  mes-
     sages.  However, unless precautions are taken, using putbq()
     with a high priority message is likely to lead to an  infin-
     ite  loop  of  putting  the message back on the queue, being
     rescheduled, pulling it off, and putting it back on.


     This  function  is  usually  called  when   bcanput(9F)   or
     canput(9F)  determines  that the message cannot be passed on
     to the next stream component. The  flow  control  parameters
     are  updated to reflect the change in the queue's status. If
     QNOENB is not set, the service routine is enabled.

RETURN VALUES
     The putbq() function returns  1  upon  success  and  0  upon
     failure.


     Upon failure, the caller should call freemsg(9F) to free the
     pointer to the message block.

CONTEXT
     The putbq() function can be called from user, interrupt,  or
     kernel context.



SunOS 5.11          Last change: 16 Jan 2006                    1






Kernel Functions for Drivers                            putbq(9F)



EXAMPLES
     See the bufcall(9F) function page for an example of putbq().

SEE ALSO
     bcanput(9F), bufcall(9F), canput(9F), getq(9F), putq(9F)


     Writing Device Drivers


     STREAMS Programming Guide












































SunOS 5.11          Last change: 16 Jan 2006                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™