Subject: Re: Linux pseudo pty
To: Greywolf <greywolf@starwolf.com>
From: Darren Reed <darrenr@reed.wattle.id.au>
List: tech-kern
Date: 02/20/2001 08:36:31
In some email I received from Greywolf, sie wrote:
> On Mon, 19 Feb 2001, Thor Lancelot Simon wrote:
> 
> # > They're not in the same device numberspace because they're not the same
> # > devices.  The /dev/pts space is set up by ptmx which basically plumbs
> # > a stream between device and process and effectively removes, i.e.,
> # > the daemon from the loop, so it doesn't actually have to process anything
> # > under Solaris.  The telnetd establishes the ptmx connection and then
> # > hands all the back/forth communication to the kernel directly.  Since
> # > the ssh processing layer is not built into the kernel, sshd uses
> # > BSD-style ptys and has to remain alive and tend to the encryption.
> #
> # That's not really an accurate description.  While it is *possible* to push
> # an arbitrary protocol-processing module onto a stream, the use of /dev/ptmx
> # to acquire a file descriptor for a pty does not imply that any such push
> # has occurred.
> #
> # You should look at what sshd (if you like), the Borman/MIT telnetd, or
> # indeed any other portable program that uses ptys does on systems that
> # don't provide BSD-style ptys.  /dev/ptmx is used, no magical modules are
> # pushed, and everything works pretty much like it would with ptys done the
> # BSD way.  Or see the Stevens book; there are good examples in there.
> 
> As usual, I stand enlightened.  I really need to expand my technical
> library.  Thanks to all for your patience at my buffoonery.

Something else I'd like to add here - with STREAMS you can convert a
connection opened with rsh into one which has line discipline properties
by pushing the various modules onto the stdin/stdout fd.  This can be
done without allocating a pty.

Darren