Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

autopush(8)

streamio(7)

strchg(1)  —  Commands

NAME

strchg, strconf - Alters and queries stream configuration

SYNOPSIS

strchg -h module1[,module2, ... modulen]

strchg -p [-a | -u module]

strchg -f file

strconf [-t | -m module]

The strchg and strconf commands modify and return information about the configuration of the Stream associated with the user’s standard input. 

FLAGS

The strchg command has three formats, which must be specified separately.  These formats offer the following flags:

-a module
When used with -p, removes all of the STREAMS modules above the topmost driver; that is, the command only affects the uppermost Stream created for a multiplexed driver, not any of the lower Streams.  This flag cannot be used with -u. 

-f fileSpecifies a file that contains a list of STREAMS modules to be pushed on the standard input Stream for a desired configuration.  The names of the modules must occupy separate lines in the file.  The strchg command pushes any module that is desired but is not present on the Stream, and pops any module that is not desired and is present on the Stream. 

-h module1[,module2, ... modulen]
Pushes the STREAMS module or modules specified by the module argument or arguments on the standard input Stream.  The command pushes the STREAMS modules on the Stream in the order that they are specified; that is, module1 is pushed first, module2 is pushed second, and so forth. 

-pPops STREAMS modules off the standard input Stream.  When the -p flag is specified without any other flags, the command removes the topmost module (the module immediately below the Stream head) from the Stream.  The -a and -u flags cannot be used simultaneously with the -p flag. 

-u module
When used with -p, pops all of the modules above the specified module off the Stream, leaving that module on it.  This flag cannot be used with -a. 

The strconf command flags are the following:

-t module
Prints the name of the topmost module on the standard input Stream, if this module exists.

-m module
Confirms whether or not the specified module module is present on the Stream. 

DESCRIPTION

The strchg command pushes and pops STREAMS modules on and off the user’s standard input Stream to achieve a desired configuration.  The strconf command queries the configuration of the Stream, then prints the names of the modules and the topmost device driver, or the name of the topmost module, or the name of a specific module. 

When the -f flag is used, the strchg command first determines the current configuration of the standard input Stream, then pushes or pops the modules named in the file argument to fix it.  The module that is named first is meant to be the one that is located below the Stream head, while the module named last is meant to be at the bottom of the Stream, closest to the device driver.  This is the opposite of the order in which the strchg command pushes and pops modules when it is invoked with the -h flag. 

To use the strchg command, you must either be the owner of the Stream or the superuser. 

Without flags, the strconf command prints the names of all of the modules, if any, and the name of the topmost driver.  Names are printed one per line, with the driver’s name last.  When the autopush mechanism is used in a system, the strconf command returns the names of the modules that were automatically pushed on the standard input Stream at the opening of the associated device.  If the Stream configuration has been changed since the device was opened, the command prints the altered list of module names. 

If the -t flag is used, the strconf command prints only the topmost module’s name, if any exists.  When the -m flag is used, the command queries the standard input Stream for the module specified in the module argument.  If this module is present on the Stream, it prints the message yes and returns a 0 (zero).  If the module is not on the Stream, strchg prints no and returns a nonzero value.  The -t and -m flags cannot be used simultaneously. 

To use the strconf command, you must either have read permission or be the superuser. 

For both the strchg and strconf commands, note that if modules are pushed onto the user’s standard input Stream in the wrong order, that Stream will not function as expected.  For example, in the case of terminal lines (ttys), the line discipline module must be pushed in the correct place; otherwise, the terminal might not respond correctly to commands. 

EXAMPLES

     1.To print out the names of the modules and driver present on the user’s standard input Stream, enter:

strconf

     2.To push the fictional line discipline module linedisp onto the the user’s standard input Stream, enter:

strchg -h linedisp

The ldterm module is pushed below the Stream head in the user’s standard input Stream. 

     3.To set up the standard input Stream (JIS) characters, and to do this using a previously created file called /$HOME/.mytty.conf that lists the modules, enter:

strchg  -f  $HOME/.mytty.conf

If the list of modules in the /$HOME/.mytty.conf file is as follows, the fictional lpass module will be pushed first, followed by the fictional linedisp module, followed by the fictional upass module. 

upass
linedisp
lpass

EXIT VALUES

The strchg command returns 0 (zero) on success.  When the command encounters an error, it returns a nonzero status and prints an error message.  The command returns errors for such conditions as a usage error, bad module name, failure of an ioctl system call, and failure to open the file specified by the -f flag. 

The strconf command returns 0 (zero) on success and a nonzero status for errors.  It prints an error message for any errors.  When the -m and -t flags return successfully, this indicates that the named, or topmost, module is present.  The error conditions that the command returns a status for include a usage error and a failure of an ioctl system call. 

RELATED INFORMATION

Commands: autopush(8). 

Interfaces: streamio(7). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026