STREAMS-UX Programmer's Guide (February 2007)

STREAMS Utilities Supported by HP-UX
Appendix B
209
NAME
SAMESTR () – Test if next queue is of the same type.
SYNOPSIS
#include <sys/stream.h>
int SAMESTR(queue_t *q);
PARAMETERS
q
Pointer to the queue.
DESCRIPTION
The SAMESTR() macro checks whether the next queue in a stream (if it exists) is of the same type (read/write)
as the current queue. This macro can be used to determine the midpoint in a STREAMS-based pipe or welded
streams where the read queue is linked to the write queue.
RETURN VALUES
SAMESTR() returns:
1 — if the next queue is of the same type as the current queue
0 — if the next queue does not exist or if it is not of the same type
CONSTRAINTS
SAMESTR() can be called from thread or interrupt context. Only spinlocks of STREAMS/UX user lock order
can be held across this call.