What's a psuedo-tty ? and What does the select on a pipe SLS do ?

Stanley Friesen sarima at tdatirv.UUCP
Fri Sep 28 10:28:16 AEST 1990


In article <783 at lafayet.UUCP> rob at lafayet.UUCP (Rob Freyder) writes:
>Hi Folks,
>	I have some simple questions. At least I think they might be. 8-)
>
>First, What is a psuedo-tty ?  I cant find it in any of my books or manuals.

A pseudo-tty is a pair of connected virtual devices such that one member of
the pair loks (almost) like a real tty port.  This allows the I/O of an
interactive program (like a shell or editor) to be connected to some filter
program (like a remote login demon or a terminal emulator for X windows).
Since the slave half of the pseudo-tty looks like a real tty, the shell
or editor chugs happily away, thinking it is connected to a terminal.
The filter or daemon on the master end can then perform added-value processing
without disturbing either the user or the interactive program.

[Note: the slave end is only *almost* like a real tty - this is kelling us
here, since we have a program that refuses to accept the limited simulation
as adequate, it wants the unsupported features.  I am rather upset by this,
a pty should be a full simulation of a real tty, not a partial one.]
 
>Second, Whais select() used for ?  I just found a program called tapserial
>that I want to compile and its needs select() which is broken on Xenix 2.3 ...
>So I installed the XNX141 SLS to fix it.  

select() is mechanism for polling multiple I/O ports for availability.  It is
most useful for a program that wants to read 'simultaneously' from several
input lines (such as a daemon).  It eliminates the need for an active polling
loop using non-blocking I/O by making the kernel do the work.  (Note, it is
actually a system call, or at least requires system support to work properly,
though it can be simulated at a high cost without it).

It also has a time-out feature with millisecond resolution, so it is also
often used to provide for fractional second sleeps.  (By setting the time-out
and giving it an empty list of I/O ports to check).

It is a Berkeley Unix feature.  The System V equivalent (or nearly so) is
called poll().



More information about the Comp.unix.xenix.sco mailing list