[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {t,p}tyr* problems (solved)



	It seems stupid to have the ttys file list all the ptys with just
	default behaviour. I know damn well how many ptys are available
	as I configured the kernel...

	To remove the need for default entries fo ptys in /etc/ttys,
	we would need ttyslot() and gettyent() modified and a new sysctl
	to get the number of ptys (useful thing to have anyway)

	We should probably define somehere the correct way to cycle through
	the available ptys (and have a library call that telnetd & friends
	can use rather than them all having their own
		"for (cp = "pqrstuvwxyzPQRST"; *cp; cp++) {
		 [...]
                 *p2 = "0123456789abcdef"[i];"
	type code - but thats another issue).

	Assuming that /etc/ttys only has hardwired terminals by default:

	The obvious things that are going to hit /etc/ttys

	    ttyflags - no problem, default terminals type has no flags.
	    
	    ttyslot - this is the problem one, I assume login will use
	    ttyslot to work out what entry in utmp to use. Need to change
	    ttyslot to start at 0 & increment for any hardwired terminal
	    it finds (must let people put ptys in there if they insist).
	    If the terminal being asked for is hardwired then it will be
	    found in that search, so just return the value. If its a pty
	    then you now know the slot for last hardwired terminal.
	    Given the ptys name you can determine what offset to add to
	    that slot.
	
	    Could map the slots with all possible ptys first, then add
	    hardwired slots on the end - easier conceptually, but less
	    optimal for programs reading utmp when users on hardwired ttys.
	
	    anything else that uses getty{nam,ent} - time to check the
	    source tree I think, init springs to mind. We really need
	    to keep the current functionality of getttyent() cycling
	    through all possible terminals.
	    
	    Make gettyent() and gettynam() use sysctl to work out if a
	    terminal is valid - they will just 'fake' a default entry
	    if the pty is valid & not listed in /etc/ttys.

	Damn - need to rush for train & wont be back online for about
	20 hours.... :(

                   David/abs             (david_(_at_)_mono_(_dot_)_org)

+44 181 888 8949 System Manager, Southern Studios Ltd, Box 59, London N22 1AR
     >=- Microsoft asks you where you want to go. Unix gets you there -=<
        <<< Monochrome - Largest UK Internet BBS - telnet mono.org >>>




Visit your host, monkey.org