sxt(7) sxt(7)NAME sxt - provides a pseudo-device driver DESCRIPTION sxt is a pseudo-device driver that interposes a discipline between the standard tty line disciplines and a real device driver. The standard disciplines manipulate virtual tty structures (channels) declared by the sxt driver. sxt acts as a discipline manipulating a real tty structure declared by a real device driver. The sxt driver is used only by the shl(1) command. Virtual ttys are named by inodes in the subdirectory /dev/sxt and are allocated in groups of up to eight. To allocate a group, a program should exclusively open a file with a name of the form /dev/sxt/??0 (channel 0) and then execute a SXTIOCLINK ioctl call to initiate the multiplexing. Only one channel, the controlling channel, can receive input from the keyboard at a time; others attempting to read will be blocked. sxt supports two groups of ioctl(2) commands. The first group contains the standard ioctl commands described in termio(7), with the following additions: TIOCEXCL Set exclusive use mode: permit no further opens until the file is closed. TIOCNXCL Reset exclusive use mode: permit further opens. The second group, which follows, are directives to sxt itself. Some of these may only be executed on channel 0. SXTIOCLINK Allocate a channel group and multiplex the virtual ttys onto the real tty. The argument is the number of channels to allocate. This command may only be executed on channel 0. Possible errors include EINVAL The argument is out of range. ENOTTY A real tty did not issue the command. ENXIO sxt did not configure linesw. January 1992 1
sxt(7) sxt(7)EBUSY Already issued an SXTIOCLINK command for this real tty. ENOMEM There is no system memory available for allocating the virtual tty structures. EBADF Did not open channel 0 before this call. SXTIOCSWTCH Set the controlling channel. Possible errors include EINVAL Gave an invalid channel number. EPERM Did not execute the command from channel 0. SXTIOCWF Cause a channel to wait until it is the controlling channel. This command returns the error EINVAL if it is given an invalid channel number. SXTIOCUBLK Turn on the loblk control flag in the virtual tty of the indicated channel. SXTIOCUBLK Turn off the loblk control flag in the virtual tty of the indicated channel. Returns the error EINVAL if it is given an invalid number or channel 0. SXTIOCSTAT Get the status (blocked on input or output) of each channel and store the argument references in the sxtblock structure. Returns the error EFAULT if it cannot write the structure. SXTIOCTRACE Enable tracing. This command has no effect if tracing is not configured. SXTIOCNOTRACE Disable tracing. This command has no effect if tracing is not configured. If the device driver is a streams device driver (see streams(7)) then it will respond to all the sxt ioctls listed earlier, provided they are made using the streams I_STR ioctl. To turn on shell layering on a streams device, 2 January 1992
sxt(7) sxt(7)first pop the normal line discipline off the stream, push the line discipline shlr onto the stream, and then push the line discipline line back onto the stream. This open file descriptor will now become the controlling virtual tty. To open a slave virtual tty, open /dev/shl and push a line discipline onto it (using line_push(3), for example). /dev/shl is a clone device so a new virtual device will automatically be opened exclusively for you (TIOCEXCL is not required or supported). FILES /dev/sxt/??[0-7] Virtual tty device files /usr/include/sys/sxt.h Driver-specific definition files /dev/shl Device file SEE ALSO ioctl(2), open(2), line_push(3), streams(7), termio(7) shl(1), stty(1) in A/UX Command Reference January 1992 3