1putbq(9F)                Kernel Functions for Drivers                putbq(9F)
2
3
4

NAME

6       putbq - place a message at the head of a queue
7

SYNOPSIS

9       #include <sys/stream.h>
10
11
12
13       int putbq(queue_t *q, mblk_t *bp);
14
15

INTERFACE LEVEL

17       Architecture independent level 1 (DDI/DKI).
18

PARAMETERS

20       q     Pointer to the queue.
21
22
23       bp    Pointer to the message block.
24
25

DESCRIPTION

27       The putbq() function places a message at the beginning of the appropri‐
28       ate section of the message queue. There are always  sections  for  high
29       priority  and ordinary messages. If other priority bands are used, each
30       will have its own section of the queue, in priority band  order,  after
31       high  priority  messages  and  before ordinary messages. putbq() can be
32       used for ordinary, priority band, and high priority messages.  However,
33       unless  precautions  are taken, using putbq() with a high priority mes‐
34       sage is likely to lead to an infinite loop of putting the message  back
35       on  the  queue,  being rescheduled, pulling it off, and putting it back
36       on.
37
38
39       This function is usually called when bcanput(9F) or  canput(9F)  deter‐
40       mines  that  the  message cannot be passed on to the next stream compo‐
41       nent. The flow control parameters are updated to reflect the change  in
42       the  queue's  status.  If  QNOENB  is  not  set, the service routine is
43       enabled.
44

RETURN VALUES

46       The putbq() function returns 1 upon success and 0 upon failure.
47
48
49       Upon failure, the caller should call freemsg(9F) to free the pointer to
50       the message block.
51

CONTEXT

53       The putbq() function can be called from user, interrupt, or kernel con‐
54       text.
55

EXAMPLES

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

SEE ALSO

60       bcanput(9F), bufcall(9F), canput(9F), getq(9F), putq(9F)
61
62
63       Writing Device Drivers
64
65
66       STREAMS Programming Guide
67
68
69
70SunOS 5.11                        16 Jan 2006                        putbq(9F)
Impressum