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

NAME

6       getq - get the next message from a queue
7

SYNOPSIS

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

INTERFACE LEVEL

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

PARAMETERS

20       q    Pointer to the queue from which the message is to be retrieved.
21
22

DESCRIPTION

24       The getq() function is used by a service ( srv(9E)) routine to retrieve
25       its enqueued messages.
26
27
28       A module or driver may include a service routine  to  process  enqueued
29       messages.  Once  the  STREAMS scheduler calls srv() it must process all
30       enqueued messages, unless prevented by flow control. getq() obtains the
31       next  available  message  from the top of the queue pointed to by q. It
32       should be called in a while loop that is exited only when there are  no
33       more messages or flow control prevents further processing.
34
35
36       If  an  attempt  was made to write to the queue while it was blocked by
37       flow control, getq() back-enables (restarts) the service  routine  once
38       it falls below the low water mark.
39

RETURN VALUES

41       If  there  is a message to retrieve, getq() returns a pointer to it. If
42       no message is queued, getq() returns a NULL pointer.
43

CONTEXT

45       The getq() function can be called from user, interrupt, or kernel  con‐
46       text.
47

EXAMPLES

49       See dupb(9F).
50

SEE ALSO

52       srv(9E),  bcanput(9F),  canput(9F), dupb(9F), putbq(9F), putq(9F), qen‐
53       able(9F)
54
55
56       Writing Device Drivers
57
58
59       STREAMS Programming Guide
60
61
62
63SunOS 5.11                        16 Jan 2006                         getq(9F)
Impressum