Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / strchg.1
blob55b1e3d7f4b3cb8e37139719ec2403747be1ee59
1 '\" te
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"
7 .SH NAME
8 strchg, strconf \- change or query stream configuration
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBstrchg\fR \fB-h\fR \fImodule1\fR [, \fImodule2\fR...]
13 .fi
15 .LP
16 .nf
17 \fBstrchg\fR \fB-p\fR [\fB-a\fR | \fB-u\fR \fImodule\fR]
18 .fi
20 .LP
21 .nf
22 \fBstrchg\fR \fB-f\fR \fIfilename\fR
23 .fi
25 .LP
26 .nf
27 \fBstrconf\fR [\fB-m\fR | \fB-t\fR \fImodule\fR]
28 .fi
30 .SH DESCRIPTION
31 .sp
32 .LP
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.
38 .sp
39 .LP
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.
44 .SH OPTIONS
45 .sp
46 .LP
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.
49 .sp
50 .ne 2
51 .na
52 \fB\fB-a\fR\fR
53 .ad
54 .sp .6
55 .RS 4n
56 Pop all the modules above the topmost driver off the stream. This option
57 requires the \fB-p\fR option.
58 .RE
60 .sp
61 .ne 2
62 .na
63 \fB\fB-f\fR\fI filename\fR \fR
64 .ad
65 .sp .6
66 .RS 4n
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.
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fB\fB-h\fR\fI module1\fR [\|,\|\fImodule2\fR.\|.\|.\|]\fR
79 .ad
80 .sp .6
81 .RS 4n
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,
85 etc.
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fB-p\fR \fR
92 .ad
93 .sp .6
94 .RS 4n
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.
97 .RE
99 .sp
100 .ne 2
102 \fB\fB-u\fR\fI module\fR \fR
104 .sp .6
105 .RS 4n
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
113 mutually exclusive.
115 .ne 2
117 \fB\fB-m\fR\fI module\fR \fR
119 .RS 14n
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.
127 .ne 2
129 \fB\fB-t\fR\fI module\fR \fR
131 .RS 14n
132 Print only the topmost module (if one exists). The \fB-t\fR and \fB-m\fR
133 options are mutually exclusive.
136 .SH EXAMPLES
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:
145 .in +2
147 example% strchg -h ldterm
149 .in -2
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
156 user.
159 .in +2
161 example% strchg -p < /dev/term/24
163 .in -2
168 If the file \fBfileconf\fR contains the following:
171 .in +2
173 ttcompat
174 ldterm
175 ptem
177 .in -2
181 then the command
184 .in +2
186 example% strchg -f fileconf
188 .in -2
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
195 the stream head.
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:
204 .in +2
206 ldterm
209 .in -2
214 The following command asks if \fBldterm\fR is on the stream:
217 .in +2
219 example% strconf -m ldterm
221 .in -2
226 and produces the following output while returning an exit status of 0:
229 .in +2
233 .in -2
236 .SH SEE ALSO
239 \fBattributes\fR(5), \fBstreamio\fR(7I)
240 .SH DIAGNOSTICS
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
254 stream.
255 .SH NOTES
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
266 any commands.