[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    getq(9F) manual page Table of Contents

Name

getq - get the next message from a queue

Synopsis


#include <sys/stream.h>

mblk_t *getq(queue_t *q);

Interface Level

Architecture independent level 1 (DDI/DKI).

Arguments

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

Description

getq() is used by a service (srv(9E) ) routine to retrieve its enqueued messages.

A module or driver may include a service routine to process enqueued messages. Once the STREAMS scheduler calls srv() it must process all enqueued messages, unless prevented by flow control. getq() obtains the next available message from the top of the queue pointed to by q. It should be called in a while loop that is exited only when there are no more messages or flow control prevents further processing.

If an attempt was made to write to the queue while it was blocked by flow control, getq() back-enables (restarts) the service routine once it falls below the low water mark.

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.

Context

getq() can be called from user or interrupt context.

Example

See dupb(9F) .

See Also

srv(9E) , bcanput(9F) , canput(9F) , dupb(9F) , putbq(9F) , putq(9F) , qenable(9F)



Table of Contents