From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12684 invoked from network); 8 May 2001 04:08:16 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 May 2001 04:08:16 -0000 Received: (qmail 22078 invoked by alias); 8 May 2001 04:08:06 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14250 Received: (qmail 22066 invoked from network); 8 May 2001 04:08:05 -0000 From: "Андрей Борзенков" To: "Bart Schaefer" Cc: zsh-workers@sunsite.dk Subject: Re[2]: Fix for zpty under Cygwin Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: [62.118.136.37] In-Reply-To: <010507124740.ZM27941@candle.brasslantern.com> Reply-To: "Андрей Борзенков" Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: Date: Tue, 08 May 2001 08:08:04 +0400 -----Original Message----- From: "Bart Schaefer" To: "Андрей Борзенков" Date: Mon, 7 May 2001 12:47:39 -0700 Subject: Re: Fix for zpty under Cygwin > > > So the fix under Cygwin is quite simple - just remove O NOCTTY. > > Actually, I wonder what it does here at all - it is exactly the > > descriptor that *will* be ctty later. > > It will be ctty in the forked-off child that runs on the pty, but we have > to open the descriptor originally in the parent before forking. O NOCTTY > is to prevent the pty from becoming the parent's controlling terminal. > That's wrong. get_pty() has two threads - one is executed in parent (master) and one in child after fork (slave). So, sfd descriptor is opened just once in child and fix looks applicable. I've tried it on my Unix as well without any obvious ill effects. Anyway, I suggested to put it under ifdef __CYGWIN__ for the time being to avoid last-time breaking on other systems. It does fix things under Cygwin (it is nice to convince Cygwin folks to change O_NOCTTY semantics of course). -andrej