Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved
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]
#include <sys/stream.h> #include <sys/ddi.h> void qprocson(queue_t *q);
void qprocsoff(queue_t *q);
Architecture independent level 1 (DDI/DKI).
Pointer to the RD side of a streams queue pair.
The qprocson() enables the put and service routines of the driver or module whose read queue is pointed to by q. Threads cannot enter the module instance through the put and service routines while they are disabled.
The qprocson() function must be called by the open routine of a driver or module before returning, and after any initialization necessary for the proper functioning of the put and service routines.
The qprocson() function must be called before calling put(9F), putnext(9F), qbufcall(9F), qtimeout(9F), qwait(9F), or qwait_sig(9F).
The qprocsoff() function must be called by the close routine of a driver or module before returning, and before deallocating any resources necessary for the proper functioning of the put and service routines. It also removes the queue's service routines from the service queue, and blocks until any pending service processing completes.
The module or driver instance is guaranteed to be single-threaded before qprocson() is called and after qprocsoff() is called, except for threads executing asynchronous events such as interrupt handlers and callbacks, which must be handled separately.
These routines can be called from user, interrupt, or kernel context.
close(9E), open(9E), put(9E), srv(9E), put(9F), putnext(9F), qbufcall(9F), qtimeout(9F), qwait(9F), qwait_sig(9F)
Writing Device Drivers
STREAMS Programming Guide
The caller may not have the stream frozen during either of these calls.