Is there any way to find real tty under shell layers?

ECSC68 S Brown CS simon at its63b.ed.ac.uk
Fri Mar 18 03:31:30 AEST 1988


In article <3932 at whuts.UUCP> paul at whuts.UUCP (KOLB) writes:
>>In article <352 at vsi.UUCP>, friedl at vsi.UUCP (Stephen J. Friedl) writes:
>>      Does anybody know any way to find out the "real" terminal
>> name when running under shell layers in Sys V?  
>
> [description of doing this using getutent() to search for a ut_line
>  that looks like ttyname(0)]
>

But shl stamps an entry for the current layer "/dev/sxtNNN" in /etc/utmp,
so this won't work. The only way I can think of is to look in /dev/kmem at
the sxt driver structures and find what real tty has your sxt (device number
got from fstat(0,...)) multiplexed onto it. It's hardly portable though (and
requires read-permission on /dev/kmem). It'd be *much* better if shl were to
store away the original tty name somewhere when it replaces it in utmp.

Of course, the real problem is that utmp is simply not good enough any more-
it was fine back in the Good Old Days, but when you have windows and ptys and
multiplexing and other good stuff like this, it loses badly.

--
--------------------------------------------------
| Simon Brown                                    |
| Laboratory for Foundations of Computer Science |
| Department of Computer Science                 |
| University of Edinburgh, Scotland, UK.         |
--------------------------------------------------
 UUCP:  ...!uunet!mcvax!ukc!lfcs!simon
 ARPA:  simon%lfcs.ed at nss.cs.ucl.ac.uk
 JANET: simon at uk.ac.ed.lfcs

-- 
--------------------------------------------------
| Simon Brown                                    |
| Laboratory for Foundations of Computer Science |
| Department of Computer Science                 |
| University of Edinburgh, Scotland, UK.         |
--------------------------------------------------
 UUCP:  ...!uunet!mcvax!ukc!lfcs!simon
 ARPA:  simon%lfcs.ed at nss.cs.ucl.ac.uk
 JANET: simon at uk.ac.ed.lfcs
-- 
--------------------------------------------------
| Simon Brown                                    |
| Laboratory for Foundations of Computer Science |
| Department of Computer Science                 |
| University of Edinburgh, Scotland, UK.         |
--------------------------------------------------
 UUCP:  uunet!mcvax!ukc!lfcs!simon
 ARPA:  simon%lfcs.ed at nss.cs.ucl.ac.uk      "Life's like that, you know"
 JANET: simon at uk.ac.ed.lfcs



More information about the Comp.unix.questions mailing list