DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5 and SCO OpenServer 5

getq(D3str)


getq -- get the next message from a queue

Synopsis

   #include <sys/stream.h>
   #include <sys/ddi.h>
   

mblk_t *getq(queue_t *q);

Description

getq 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.

Arguments


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

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.

Usage

getq is typically used by service routines [see srv(D2str)] to retrieve queued messages.

Context

Base or Interrupt.

Synchronization constraints

Does not block.

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(D3str)) when calling this function.

Examples

See srv(D2str) for an example of getq.

Hardware applicability

All

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

References

bcanput(D3str), canput(D3str), putbq(D3str), putq(D3str), qenable(D3str), rmvq(D3str), srv(D2str)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005