diff options
author | Egor Duda <deo@logos-m.ru> | 2001-03-04 15:34:25 +0000 |
---|---|---|
committer | Egor Duda <deo@logos-m.ru> | 2001-03-04 15:34:25 +0000 |
commit | 306c4b6737136c7bb45228c284502eb643ec95ac (patch) | |
tree | 88b3eeaefe560eb41d42081a5648a15a40ec6eea /winsup/cygwin/tty.cc | |
parent | 0312ede431278fb8a0aa6db9ae201d928d3b0055 (diff) | |
download | cygnal-306c4b6737136c7bb45228c284502eb643ec95ac.tar.gz cygnal-306c4b6737136c7bb45228c284502eb643ec95ac.tar.bz2 cygnal-306c4b6737136c7bb45228c284502eb643ec95ac.zip |
* fhandler.h (class fhandler_tty_common): New mutex and event to
syncronize input on master tty with slave tty.
* fhandler_tty.cc (fhandler_pty_master::accept_input): Use them to
syncronize with slave.
* fhandler_tty.cc (fhandler_tty_slave::read): Use input mutex and
event to syncronize with master. Do not limit amount of data read
from master to vmin value. Interrupt on signal and return already
read data, if any.
* fhandler_tty.cc (fhandler_tty_slave::open): Handle input mutex and
event.
* fhandler_tty.cc (fhandler_tty_common::close): Ditto.
* fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Ditto.
* fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Ditto.
* fhandler_tty.cc (fhandler_tty_common::dup): Ditto.
* tty.h (tty::open_input_mutex): New function.
* tty.cc (tty::common_init): Create input mutex and event.
Diffstat (limited to 'winsup/cygwin/tty.cc')
-rw-r--r-- | winsup/cygwin/tty.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc index baff0a4c2..070fa3e28 100644 --- a/winsup/cygwin/tty.cc +++ b/winsup/cygwin/tty.cc @@ -408,6 +408,9 @@ tty::common_init (fhandler_pty_master *ptym) return FALSE; } + if (!(ptym->input_available_event = get_event (INPUT_AVAILABLE_EVENT, FALSE))) + return FALSE; + char buf[40]; __small_sprintf (buf, OUTPUT_MUTEX, ntty); if (!(ptym->output_mutex = CreateMutex (&sec_all, FALSE, buf))) @@ -417,7 +420,16 @@ tty::common_init (fhandler_pty_master *ptym) return FALSE; } + __small_sprintf (buf, INPUT_MUTEX, ntty); + if (!(ptym->input_mutex = CreateMutex (&sec_all, FALSE, buf))) + { + termios_printf ("can't create %s", buf); + set_errno (ENOENT); + return FALSE; + } + ProtectHandle1 (ptym->output_mutex, output_mutex); + ProtectHandle1 (ptym->input_mutex, input_mutex); winsize.ws_col = 80; winsize.ws_row = 25; |