* cygwin.din: Remove some _tc* exports. Add tcgetsid().

* dtable.cc (fh_alloc): Revert ill-advised setting of major/minor.  Use new
is_dev_tty to remember that this device was opened as /dev/tty.
* fhandler.cc (fhandler_base::fstat): Remove leftover debugging statement.
(fhandler_base::tcgetsid): New function.
* fhandler.h ((fhandler_base::tcgetsid): Declare new function.
(fhandler_base::is_dev_tty): Ditto.
(fhandler_termios::opened_as_dev_tty): Declare new field.
(fhandler_termios::is_dev_tty): Declare new function.
(fhandler_termios::tcgetsid): Ditto.
(fhandler_pty_common::use_archetype): Move here from subclass.
(fhandler_pty_slave::use_archetype): Move up.
(fhandler_pty_master::use_archetype): Ditto.
* fhandler_console.cc (fhandler_console::ioctl): Rename second argument from
`buf' to `arg' for consistency.  Call ioctl_termios for common fhandler_termios
ioctl handling.
* fhandler_tty.cc (fhandler_pty_slave::ioctl): Call ioctl_termios for common
fhandler_termios ioctl handling.
(fhandler_pty_master::ioctl): Ditto.
* fhandler_termios.cc (fhandler_termios::tcgetsid): Implement new function.
(fhandler_termios::ioctl_termios): Ditto.  Implements TIOCSCTTY handling.
* syscalls.cc (stat_worker): Set /dev/tty device info when appropriate.
* termios.cc (tcgetpgrp): Avoid extraneous "isatty" check.
(tcgetsid): Implement new function.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 253.
* include/sys/termios.h (TIOCSCTTY): Define.
This commit is contained in:
Christopher Faylor
2011-10-11 23:20:38 +00:00
parent 14b9008cca
commit 4add6f8db1
12 changed files with 132 additions and 33 deletions

View File

@@ -145,7 +145,7 @@ fhandler_pty_master::accept_input ()
rc = WriteFile (get_output_handle (), p, bytes_left, &written, NULL);
if (!rc)
{
debug_printf ("error writing to pipe %E");
debug_printf ("error writing to pipe %p %E", get_output_handle ());
get_ttyp ()->read_retval = -1;
ret = -1;
}
@@ -947,6 +947,9 @@ int
fhandler_pty_slave::ioctl (unsigned int cmd, void *arg)
{
termios_printf ("ioctl (%x)", cmd);
int res = ioctl_termios (cmd, (int) arg);
if (res <= 0)
return res;
if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid
&& (unsigned) myself->ctty == FHDEV (DEV_TTYS_MAJOR, get_unit ())
@@ -1358,6 +1361,10 @@ fhandler_pty_master::tcflush (int queue)
int
fhandler_pty_master::ioctl (unsigned int cmd, void *arg)
{
int res = ioctl_termios (cmd, (int) arg);
if (res <= 0)
return res;
switch (cmd)
{
case TIOCPKT: