STREAMS-UX Programmer's Guide (February 2007)

STREAMS Commands
strchg and strconf
Appendix G
293
strchg and strconf
The strchg and strconf commands are used to change or query the configuration of the stream associated with
the user's standard input. The strchg command pushes modules on and/or pops modules off the stream. The
strconf command queries the configuration of the stream. Only a user with appropriate privileges or owner of
a STREAMS device may alter the configuration of that stream.
The syntax options for the strchg command are:
strchg -h module1 [, module2]...
strchg -p [ -a|-u module]
strchg -f file
-h module1[,module2] ... strchg pushes modules onto a stream. The modules are pushable STREAMS
modules as defined by module1, module2, and so on. The modules are pushed in order. That
is, module1 is pushed first, module2 is pushed second, etc.
-p strchg pops the topmost module from the stream.
-p -a strchg pops all the modules above the topmost driver.
-p -a strchg pops all the modules above the topmost driver.
-p -u strchg pops all the modules above module.
The -a and -u options are mutually exclusive.
-f file The user can specify a file that contains a list of modules representing the desired
configuration of the stream. Each module name must appear on a separate line where the
first name represents the topmost module and the last name represents the module that
should be closest to the driver. The strchg command will determine the current
configuration of the stream and pop and push the necessary modules in order to end up with
the desired configuration.
The -h, -f, and -p options are mutually exclusive.
NOTE If the user is neither the owner of the stream nor a user with appropriate privileges, the
strchg command will fail. If the user does not have read permissions on the stream or
appropriate privileges, the strconf command will fail. If modules are pushed in the wrong
order, the stream may not function as expected. For ttys, if the line discipline module is not
pushed in the correct place, the terminal may not respond to any command.
Diagnostics
strchg returns zero on success. It prints an error message and returns non-zero status for various error
conditions, including usage error, bad module name, too many modules to push, failure of an ioctl on the
stream, or failure to open file from the -f option.
strconf returns zero on success (for the -m or -t option, success indicates that the named or topmost
module is present).
strconf returns a non-zero status if invoked with the -m or -t option, and if the module is not present.
strconf prints an error message and returns non-zero status for various error conditions, including usage
error or failure of an ioctl on the stream.