Subject: re: Linux pseudo pty
To: Todd Vierling <>
From: Greywolf <>
List: tech-kern
Date: 02/14/2001 21:33:08
On Wed, 14 Feb 2001, Todd Vierling wrote:

# On Wed, 14 Feb 2001, Greywolf wrote:
# : # :    The ptmx emulation code could be ripped out of compat_svr4 and put into
# : # :    compat/common with dependencies on either linux *or* svr4....
# : # :
# : # : no, it should become part of NetBSD proper.  we *want* UNIX98 ptys.
# :
# : Do we want the /dev/pts/.* garbage to replace the current naming scheme,
# : or would it be possible to have a cloner coexist with the current
# : /dev/tty.. scheme?
# It can coexist.  Now, whether it should overlap the same device numberspace,
# I'm not so sure.

Sigh.  Oh, well, I guess we gotta go that way sooner or later.
I'm starting not to be able to tell the difference between BSD and SysV

# Solaris, for instance, provides BSD-style (SunOS 4 compatibility) ptys named
# /dev/[pt]typ[0-9] and so forth, but they aren't in the same device
# numberspace, because the naming scheme is quite limited.  In the case of
# /dev/pts having its own device space, you could have as many nodes as you
# want (or even a kernel fs similar to fdesc), without worrying about running
# out of letters.

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.

Now if we could find a slim way to hand off the encryption bits for ssh
into the kernel (BLOAT BLOAT BLOAT I know, I know, but...), we could
probably bypass the entire BSD pty structure altogether and let the
ssh stuff just stream right through without the assistance of the sshd.

This is how it works according to several sysadmins I've talked with.
Did they or I miss something here?

Thoughts, comments?

[I know, I'm sitting here bitching about the change, and then doing a
180.  Well hell, folks, if we're going that direction, might as well
do it whole hog.  If we could set up secure pty streams in the kernel,
we'd be another leg up on Solaris.  Then all that'd remain is threads,
SMP and Ultra support. :-)  But that's another pointer to an array of
functions returning arrays of pointers to cans of worms.]

I'm sorry if I'm being less than helpful.

Microsoft:	"Where do you want to go today?"
Linux:		"Where do you want to be tomorrow?"
*BSD:		"Are you guys coming, or what?"