xref: /illumos-gate/usr/src/man/man9f/SAMESTR.9f (revision bbf21555)
te
Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
Copyright 1989 AT&T
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
SAMESTR 9F "Jan 16, 2006"
NAME
SAMESTR, samestr - test if next queue is in the same stream
SYNOPSIS

#include <sys/stream.h>



int SAMESTR(queue_t *q);
INTERFACE LEVEL

Architecture independent level 1 (DDI/DKI).

PARAMETERS
q

Pointer to the queue.

DESCRIPTION

The SAMESTR() function is used to see if the next queue in a stream (if it exists) is the same type as the current queue (that is, both are read queues or both are write queues). This function accounts for the twisted queue connections that occur in a STREAMS pipe and should be used in preference to direct examination of the q_next field of queue(9S) to see if the stream continues beyond q.

RETURN VALUES

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

CONTEXT

The SAMESTR() function can be called from user, interrupt, context.

SEE ALSO

OTHERQ (9F)

Writing Device Drivers

STREAMS Programming Guide