Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Tue, 9 Oct 2001 09:01:14 +0200
From: Corinna Vinschen <cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Why does fhandler_tty_slave::open call attach_tty?
Message-ID: <20011009090114.R12872@cygbert.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <200110090532.f995WZi02764@cate2-108.reshall.ou.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <200110090532.f995WZi02764@cate2-108.reshall.ou.edu>; from jcast@ou.edu on Tue, Oct 09, 2001 at 12:32:34AM -0500

On Tue, Oct 09, 2001 at 12:32:34AM -0500, Jon Cast wrote:
> 
> cgf told me to submit patches here, since I'm not planning on becoming
> a major contributor to Cygwin.  However, I'm not sure if this is the
> correct place to submit questions about the Cygwin code to.  Hoping it
> is, here's my question.
> 
> fhandler_tty_slave::open begins with the following code:
> 
> -- 461 --
> >  tcinit (cygwin_shared->tty[ttynum]);
> >
> >  attach_tty (ttynum);
> >  tc->set_ctty (ttynum, flags);
> 
> attach_tty just calls tty_list::connect_tty, which in turn just
> verifies the tty number and returns it if it's meaningful.
> 
> However, that return code isn't used by fhandler_tty_slave::open.
> What is attach_tty supposed to do, and why is it called here?
> 
> Also, what does tty_min::set_ctty do?  I have a feeling one or both of
> these is intended to set the controlling tty of the process.  If so,
> what is the recommended way to get around this code in
> fhandler_tty_slave::open (as openpty needs to do)?
> 
> Finally, are there any design documents I'm missing?

Did you have a look into the openpty() implementation
in the inetutils package?  It doesn't need any of the
internals.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

