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: Thu, 17 May 2001 19:00:31 -0400
From: Christopher Faylor <cgf@redhat.com>
To: Cygwin Mailing List <Cygwin@cygwin.com>
Subject: Re: O_NOCTTY flag sticky under Cygwin
Message-ID: <20010517190031.A3836@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: Cygwin Mailing List <Cygwin@cygwin.com>
References: <002b01c0d7c4$815a1420$21c9ca95@mow.siemens.ru>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.11i
In-Reply-To: <002b01c0d7c4$815a1420$21c9ca95@mow.siemens.ru>; from Andrej.Borsenkow@mow.siemens.ru on Tue, May 08, 2001 at 05:40:54PM +0400

On Tue, May 08, 2001 at 05:40:54PM +0400, Andrej Borsenkow wrote:
>It appears, that O_NOCTTY is sticky. I.e. if a tty was opened with this flag,
>it will never become a controlling tty. The following pseudo code:
>
>fd = open("/dev/pts/1", O_RDWR|O_NOCTTY);
>close(0);
>close(1);
>close(2);
>dup2(fd,0);
>
>does not make /dev/pts/1 controlling tty under Cygwin. It does it on most
>major Unix flavours (Solaris, Linux, BSD, AIX, HP-UX).
>
>If I understand SUS V2 correctly, this flag applies only to open() call
>itself:
>
>O_NOCTTY
>If set and path identifies a terminal device, open() will not cause the
>terminal device to become the controlling terminal for the process.

Hmm.  I made an obvious fix for this to Cygwin and Corinna reported that
this broke ssh.  Apparently something in ssh is relying on this
functionality.

I'll have to investigate more under linux.

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

