putbq(D3) putbq(D3)
NAME
putbq - place a message at the head of a queue
SYNOPSIS
#include <sys/stream.h>
#include <sys/ddi.h>
int putbq(queue_t *q, mblk_t *bp);
Arguments
q Pointer to the queue.
bp Pointer to the message.
DESCRIPTION
putbq puts a message back at the head of a queue. If messages
of a higher priority are on the queue, then bp is placed at
the head of its corresponding priority band. See srv(D2) for
more information about message priorities.
All flow control parameters are updated. The queue's service
routine is scheduled if it has not been disabled by a previous
call to noenable(D3).
Return Values
putbq returns 1 on success and 0 on failure.
USAGE
putbq is usually called when bcanput(D3) or canput(D3) [or,
for multithreaded drivers, bcanputnext(D3) or canputnext(D3)]
determines that the message cannot be passed on to the next
stream component.
putbq can fail if there is not enough memory to allocate the
accounting data structures used with messages whose priority
bands are greater than zero.
High priority messages should never be put back on a queue
from within a service routine.
Level
Base or Interrupt.
Synchronization Constraints
Does not sleep.
Copyright 1994 Novell, Inc. Page 1
putbq(D3) putbq(D3)
Driver-defined basic locks, read/write locks, and sleep locks
may be held across calls to this function.
The caller cannot have the stream frozen [see freezestr(D3)]
when calling this function.
Examples
See bufcall(D3) for an example of putbq.
REFERENCES
bcanput(D3), bcanputnext(D3), canput(D3), canputnext(D3),
getq(D3), insq(D3), msgb(D4), putq(D3), queue(D4), rmvq(D3),
srv(D2)
NOTICES
Portability
All processors
Applicability
ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp
Copyright 1994 Novell, Inc. Page 2