Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Jun 1996 15:51:27 +0000
From:      Matt Thomas <matt@lkg.dec.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        hackers@freebsd.org
Subject:   Re: PR conf/1270 
Message-ID:  <199606031551.PAA25025@whydos.lkg.dec.com>
In-Reply-To: Your message of "Mon, 03 Jun 1996 08:33:50 %2B1000." <199606022233.IAA09273@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help

> There is a problem with dangling pointers.  See kern_exit.c:
> 
> 			/*
> 			 * s_ttyp is not zero'd; we use this to indicate
> 			 * that the session once had a controlling terminal.
> 			 * (for logging and informational purposes)
> 			 */
> 
> and some things follow the pointer for closed devices.  Perhaps only
> applications like ptstat -t.  pstat also wants to work with an array of
> tty structs.

Digital UNIX had the same misfeature.  Which is why it now uses 
a vnode reference:

        struct  vnode *s_ttyvp; /* vnode of controlling terminal */

This also allows other things than classic ttys to be controlling 
terminals (say streams devices or portals or ...).

> The same problems interfere with dynamic allocation of tty structs for
> hardware ttys, but there is less to be gained by dynamic allocation in
> this case.  The closed tty structs are a good place for holding statstics
> and the state for the next open (they don't actually hold much of it now).

But that doesn't hold true for ptys.

-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt.html
Westford, MA              Disclaimer: I disavow all knowledge of this message





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606031551.PAA25025>