Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ wscons(7) — SunOS 5.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

console(7)

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 frame buffer, 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 frame buffer, 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. 

ENOSTR target does not denote a STREAMS device. 

FILES

/dev/wscons the workstation console, accessed by way of the redirection facility

SEE ALSO

console(7)

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: 3 Oct 1991

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