This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

O_NOCTTY flag sticky under Cygwin


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]