Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Tue, 9 Oct 2001 13:05:42 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Why does fhandler_tty_slave::open call attach_tty? Message-ID: <20011009130542.A25039@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <200110090532 DOT f995WZi02764 AT cate2-108 DOT reshall DOT ou DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200110090532.f995WZi02764@cate2-108.reshall.ou.edu> User-Agent: Mutt/1.3.21i 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? I think your analysis is correct. This could be an artifact of an earlier attach_tty implementation. It's probably ok to just remove the attach_tty if you want to try it and see if it works. > >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)? set_ctty sets the controlling terminal for the process if there is not one assigned. If you inspect the code you should be able to see how to avoid doing this. You set the standard UNIX flags. >Finally, are there any design documents I'm missing? Any available information is talked about here: http://cygwin.com/contrib.html cgf -- 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/