DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

SAMESTR(D3str)


SAMESTR -- test if next queue is of the same type

Synopsis (Not in ODDI)

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

int SAMESTR(queue_t *q);

Description

The SAMESTR function checks whether the next queue in a stream (if it exists) is of the same type as the current queue (that is, both are read queues or both are write queues).

Arguments


q
Pointer to the queue.

Return values

SAMESTR returns 1 if the next queue is of the same type as the current queue. It returns 0 if the next queue does not exist or if it is not of the same type.

Usage

This function can be used to determine the point in a STREAMS-based pipe where a read queue is linked to a write queue.

In multithreaded DDI drivers, the q argument may not reference q_next (for example, an argument of q->q_next is erroneous in a multithreaded driver and is disallowed by the DDI).

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.

For DDI drivers, the caller cannot have the stream frozen (see freezestr(D3str)) when calling this function.

Hardware applicability

All

Version applicability

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

References

OTHERQ(D3str)

Examples

See the put(D2str) manual page for an example of SAMESTR.
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005