1strchg(1) User Commands strchg(1)
2
3
4
6 strchg, strconf - change or query stream configuration
7
9 strchg -h module1 [, module2...]
10
11
12 strchg -p [-a | -u module]
13
14
15 strchg -f filename
16
17
18 strconf [-m | -t module]
19
20
22 These commands are used to alter or query the configuration of the
23 stream associated with the user's standard input. The strchg command
24 pushes modules on and/or pops modules off the stream. The strconf com‐
25 mand queries the configuration of the stream. Only the super-user or
26 owner of a STREAMS device can alter the configuration of that stream.
27
28
29 Invoked without any arguments, strconf prints a list of all the modules
30 in the stream as well as the topmost driver. The list is printed with
31 one name per line where the first name printed is the topmost module on
32 the stream (if one exists) and the last item printed is the name of the
33 driver.
34
36 The following options apply to strchg and, -h, -f, and -p are mutually
37 exclusive.
38
39 -a
40
41 Pop all the modules above the topmost driver off the stream. This
42 option requires the -p option.
43
44
45 -f filename
46
47 Specify a filename that contains a list of modules representing the
48 desired configuration of the stream. Each module name must appear
49 on a separate line where the first name represents the topmost mod‐
50 ule and the last name represents the module that should be closest
51 to the driver. strchg determines the current configuration of the
52 stream and pop and push the necessary modules in order to end up
53 with the desired configuration.
54
55
56 -h module1 [,module2...]
57
58 Mnemonic for push, pushes modules onto a stream. It takes as argu‐
59 ments the names of one or more pushable streams modules. These mod‐
60 ules are pushed in order; that is, module1 is pushed first, module2
61 is pushed second, etc.
62
63
64 -p
65
66 Mnemonic for pop, pops modules off the stream. With the -p option
67 alone, strchg pops the topmost module from the stream.
68
69
70 -u module
71
72 All modules above, but not including module are popped off the
73 stream. This option requires the -p option.
74
75
76
77 The following options apply to strconf and, -m and -t are mutually
78 exclusive.
79
80 -m module Determine if the named module is present on a stream. If
81 it is, strconf prints the message yes and returns zero.
82 If not, strconf prints the message no and returns a non-
83 zero value. The -t and -m options are mutually exclusive.
84
85
86 -t module Print only the topmost module (if one exists). The -t and
87 -m options are mutually exclusive.
88
89
91 Example 1 Using the strchg Command
92
93
94 The following command pushes the module ldterm on the stream associated
95 with the user's standard input:
96
97
98 example% strchg -h ldterm
99
100
101
102
103 The following command pops the topmost module from the stream associ‐
104 ated with /dev/term/24. The user must be the owner of this device or
105 the super user.
106
107
108 example% strchg -p < /dev/term/24
109
110
111
112
113 If the file fileconf contains the following:
114
115
116 ttcompat
117 ldterm
118 ptem
119
120
121
122 then the command
123
124
125 example% strchg -f fileconf
126
127
128
129
130 configures the user's standard input stream so that the module ptem is
131 pushed over the driver, followed by ldterm and ttcompat closest to the
132 stream head.
133
134
135
136 The strconf command with no arguments lists the modules and topmost
137 driver on the stream; for a stream that has only the module ldterm
138 pushed above the zs driver, it would produce the following output:
139
140
141 ldterm
142 zs
143
144
145
146
147 The following command asks if ldterm is on the stream:
148
149
150 example% strconf -m ldterm
151
152
153
154
155 and produces the following output while returning an exit status of 0:
156
157
158 yes
159
160
161
163 See attributes(5) for descriptions of the following attributes:
164
165
166
167
168 ┌───────────────────────────────────────────────────────────┐
169 │ATTRIBUTE TYPE ATTRIBUTE VALUE │
170 │Availability SUNWcsu │
171 └───────────────────────────────────────────────────────────┘
172
174 attributes(5), streamio(7I)
175
177 strchg returns zero on success. It prints an error message and returns
178 non-zero status for various error conditions, including usage error,
179 bad module name, too many modules to push, failure of an ioctl on the
180 stream, or failure to open filename from the -f option.
181
182
183 strconf returns zero on success (for the -m or -t option, "success"
184 means the named or topmost module is present). It returns a non-zero
185 status if invoked with the -m or -t option and the module is not
186 present. It prints an error message and returns non-zero status for
187 various error conditions, including usage error or failure of an ioctl
188 on the stream.
189
191 If the user is neither the owner of the stream nor the super-user, the
192 strchg command fails. If the user does not have read permissions on the
193 stream and is not the super user, the strconf command fails.
194
195
196 If modules are pushed in the wrong order, one could end up with a
197 stream that does not function as expected. For ttys, if the line disci‐
198 pline module is not pushed in the correct place, one could have a ter‐
199 minal that does not respond to any commands.
200
201
202
203SunOS 5.11 24 Mar 2005 strchg(1)