2 .\" Copyright 1989 AT&T Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH STRCHG 1 "Mar 24, 2005"
8 strchg, strconf \- change or query stream configuration
12 \fBstrchg\fR \fB-h\fR \fImodule1\fR [, \fImodule2\fR...]
17 \fBstrchg\fR \fB-p\fR [\fB-a\fR | \fB-u\fR \fImodule\fR]
22 \fBstrchg\fR \fB-f\fR \fIfilename\fR
27 \fBstrconf\fR [\fB-m\fR | \fB-t\fR \fImodule\fR]
33 These commands are used to alter or query the configuration of the stream
34 associated with the user's standard input. The \fBstrchg\fR command pushes
35 modules on and/or pops modules off the stream. The \fBstrconf\fR command
36 queries the configuration of the stream. Only the super-user or owner of a
37 STREAMS device can alter the configuration of that stream.
40 Invoked without any arguments, \fBstrconf\fR prints a list of all the modules
41 in the stream as well as the topmost driver. The list is printed with one name
42 per line where the first name printed is the topmost module on the stream (if
43 one exists) and the last item printed is the name of the driver.
47 The following options apply to \fBstrchg\fR and, \fB\fR\fB-h\fR\fB,\fR
48 \fB\fR\fB-f\fR\fB,\fR and \fB-p\fR are mutually exclusive.
56 Pop all the modules above the topmost driver off the stream. This option
57 requires the \fB-p\fR option.
63 \fB\fB-f\fR\fI filename\fR \fR
67 Specify a \fIfilename\fR that contains a list of modules representing the
68 desired configuration of the stream. Each module name must appear on a separate
69 line where the first name represents the topmost module and the last name
70 represents the module that should be closest to the driver. \fBstrchg\fR
71 determines the current configuration of the stream and pop and push the
72 necessary modules in order to end up with the desired configuration.
78 \fB\fB-h\fR\fI module1\fR [\|,\|\fImodule2\fR.\|.\|.\|]\fR
82 Mnemonic for pus\fIh\fR, pushes modules onto a stream. It takes as arguments
83 the names of one or more pushable streams modules. These modules are pushed in
84 order; that is, \fImodule1\fR is pushed first, \fImodule2\fR is pushed second,
95 Mnemonic for po\fIp\fR, pops modules off the stream. With the \fB-p\fR option
96 alone, \fBstrchg\fR pops the topmost module from the stream.
102 \fB\fB-u\fR\fI module\fR \fR
106 All modules above, but not including \fImodule\fR are popped off the stream.
107 This option requires the \fB-p\fR option.
112 The following options apply to \fBstrconf\fR and, \fB-m\fR and \fB-t\fR are
117 \fB\fB-m\fR\fI module\fR \fR
120 Determine if the named \fImodule\fR is present on a stream. If it is,
121 \fBstrconf\fR prints the message \fByes\fR and returns zero. If not,
122 \fBstrconf\fR prints the message \fBno\fR and returns a non-zero value. The
123 \fB-t\fR and \fB-m\fR options are mutually exclusive.
129 \fB\fB-t\fR\fI module\fR \fR
132 Print only the topmost module (if one exists). The \fB-t\fR and \fB-m\fR
133 options are mutually exclusive.
138 \fBExample 1 \fRUsing the \fBstrchg\fR Command
141 The following command pushes the module \fBldterm\fR on the stream associated
142 with the user's standard input:
147 example% strchg -h ldterm
154 The following command pops the topmost module from the stream associated with
155 \fB/dev/term/24\fR. The user must be the owner of this device or the super
161 example% strchg -p < /dev/term/24
168 If the file \fBfileconf\fR contains the following:
186 example% strchg -f fileconf
193 configures the user's standard input stream so that the module \fBptem\fR is
194 pushed over the driver, followed by \fBldterm\fR and \fBttcompat\fR closest to
199 The \fBstrconf\fR command with no arguments lists the modules and topmost
200 driver on the stream; for a stream that has only the module \fBldterm\fR pushed
201 above the \fBzs\fR driver, it would produce the following output:
214 The following command asks if \fBldterm\fR is on the stream:
219 example% strconf -m ldterm
226 and produces the following output while returning an exit status of 0:
239 \fBattributes\fR(5), \fBstreamio\fR(7I)
243 \fBstrchg\fR returns zero on success. It prints an error message and returns
244 non-zero status for various error conditions, including usage error, bad module
245 name, too many modules to push, failure of an ioctl on the stream, or failure
246 to open \fIfilename\fR from the \fB-f\fR option.
249 \fBstrconf\fR returns zero on success (for the \fB-m\fR or \fB-t\fR option,
250 "success" means the named or topmost module is present). It returns a non-zero
251 status if invoked with the \fB-m\fR or \fB-t\fR option and the module is not
252 present. It prints an error message and returns non-zero status for various
253 error conditions, including usage error or failure of an \fBioctl\fR on the
258 If the user is neither the owner of the stream nor the super-user, the
259 \fBstrchg\fR command fails. If the user does not have read permissions on the
260 stream and is not the super user, the \fBstrconf\fR command fails.
263 If modules are pushed in the wrong order, one could end up with a stream that
264 does not function as expected. For ttys, if the line discipline module is not
265 pushed in the correct place, one could have a terminal that does not respond to