getq(D3)getq(D3)NAMEgetq - get the next message from a queue
SYNOPSIS
#include <sys/stream.h>
#include <sys/ddi.h>
mblk_t *getq(queue_t *q);
Arguments
q Pointer to the queue from which the message is to be retrieved.
DESCRIPTIONgetq gets the next available message from the top of the queue pointed to
by q. It handles flow control, restarting I/O that was blocked as
needed.
Return Values
If there is a message to retrieve, getq returns a pointer to it. If no
message is queued, getq returns a NULL pointer.
USAGEgetq is typically used by service routines [see srv(D2)] to retrieve
queued messages.
Level
Base or Interrupt.
Synchronization Constraints
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may be held
across calls to this function.
Examples
See srv(D2) for an example of getq.
REFERENCESbcanput(D3), canput(D3), putbq(D3), putq(D3), qenable(D3), rmvq(D3),
srv(D2)
Page 1