Subject: Re: bin/5904: telnetd does not skip ttyv*
To: Todd Whitesel <toddpw@best.com>
From: Zdenek Salvet <salvet@ics.muni.cz>
List: tech-userlevel
Date: 08/05/1998 11:58:02
> > > or: dedicate /dev/ttyc? to console ttys, thus releasing 'v' for pty use.
> > 
> > That would require some logic in X servers to detect whether it should use
> > /dev/ttyc* or /dev/ttyv* .
> > FYI, telnetd now uses openpty(), so the change would be easier than before.
> 
> Before I say something I might regret, would someone please explain to me why
> the X servers need to special-case on the names of the console terminals, as
> opposed to just ioctl'ing the thing to see if it is a pcvt device or not?

This is needed in order to find the device filename of free virtual screen from
a screen number. Such change is already present for OpenBSD:

#ifndef __OpenBSD__
    vtprefix = "/dev/ttyv";
#else
    vtprefix = "/dev/ttyC";
#endif

I would prefer to have some logic to detect /dev/ttyC* vs. /dev/ttyv*,
like following (for wscons):

    fd = open(PCVT_CONSOLE_DEV, PCVT_CONSOLE_MODE, 0);

#ifdef WSCONS_PCVT_COMPAT_CONSOLE_DEV
    if (fd < 0)
    {
        fd = open(WSCONS_PCVT_COMPAT_CONSOLE_DEV, PCVT_CONSOLE_MODE, 0);
        vtprefix = "/dev/ttyE";
    }
#endif

Code snippets are from
xsrc/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c

-- 
Zdenek Salvet                                              salvet@ics.muni.cz 
----------------------------------------------------------------------------
           If God had meant for us to be in the Army,
         we would have been born with green, baggy skin.