wscons(7)
NAME
wscons − workstation console
SYNOPSIS
#include <sys/strredir.h>
ioctl(fd, SRIOCSREDIR, target);
ioctl(fd, SRIOCISREDIR, target);
DESCRIPTION
The “workstation console” is a device consisting of the combination of the workstation keyboard and display device, acting in concert to emulate an ASCII terminal. It includes a redirection facility that allows I/O issued to the workstation console to be diverted to some other STREAMS device, so that, for example, window systems can arrange to redirect output that would otherwise appear directly on the display device, corrupting its appearance.
Redirection
The redirection facility maintains a list of devices that have been named as redirection targets, through the SRIOCSREDIR ioctl described below. All entries but the most recent are inactive; when the currently active entry is closed, the most recent remaining entry becomes active. The active entry acts as a proxy for the device being redirected; it handles all read(2), write(2), ioctl(2), and poll(2) calls issued against the redirectee.
The following two ioctls control the redirection facility. In both cases, fd is a descriptor for the device being redirected (that is, the workstation console) and target is a descriptor for a STREAMS device.
SRIOCSREDIR Make target be the source and destination of I/O ostensibly directed to the device denoted by fd.
SRIOCISREDIR Returns 1 if target names the device currently acting as proxy for the device denoted by fd, and 0 if it is not.
RETURN VALUES
When there are no errors, the redirection ioctls have return values as described above. Otherwise, they return -1 and set errno to indicate the error.
If the target stream is in an error state, errno is set accordingly.
ERRORS
EBADF target does not denote an open file.
EINVAL fd does not denote /dev/console.
ENOSTR target does not denote a STREAMS device.
EINVAL fd does not denote /dev/console.
FILES
/dev/systty
/dev/syscon
/dev/console the device that must be opened for the SRIOCSREDIR and SRIOCISREDIR ioctls
/dev/wscons the workstation console, accessed by way of the redirection facility
SEE ALSO
WARNINGS
The redirection ioctls block while there is I/O outstanding on the device instance being redirected. Thus, attempting to redirect the workstation console while there is a read outstanding on it will hang until the read completes.
SunOS 5.1 — Last change: 22 January 93