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
X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de)
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "Cygwin Mailing List" <Cygwin@Sourceware.Cygnus.Com>
Subject: O_NOCTTY flag sticky under Cygwin
Date: Tue, 8 May 2001 17:40:54 +0400
Message-ID: <002b01c0d7c4$815a1420$21c9ca95@mow.siemens.ru>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="koi8-r"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Importance: Normal

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.

-andrej

Have a nice DOS!
B >>


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

