diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2001-09-27 02:12:18 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2001-09-27 02:12:18 (GMT) |
commit | ad5d4c44dddeb52181fed7f22de9891cf7cdf5d3 (patch) | |
tree | 0beb65d7525d5189c5c642af4a1584434db45e64 /generic/tclIO.h | |
parent | 8169f6e6c3e800d51a270d34d7ff6078e8fc80fa (diff) | |
download | tcl-ad5d4c44dddeb52181fed7f22de9891cf7cdf5d3.zip tcl-ad5d4c44dddeb52181fed7f22de9891cf7cdf5d3.tar.gz tcl-ad5d4c44dddeb52181fed7f22de9891cf7cdf5d3.tar.bz2 |
* The changes below fix [Bug #462317] where Expect tried to read
more than was in the buffers and then blocked in the OS call as
its pty channel driver provides no blockmodeproc through which
the OS could be notified of blocking-behaviour. Because of this
the general I/O core has to take more care than usual to
preserve the semantics of non-blocking channels.
* generic/tclIO.c (Tcl_ReadRaw): Do not read from the driver if
the channel is non-blocking and the fileevent causing the read
was generated by a timer. We do not know if there is data
available from the OS. Instead of going to the OS for more and
potentially blocking we simply signal EWOULDBLOCK to the higher
levels to cause the system to wait for true fileevents.
(GetInput): Same as before.
(ChannelTimerProc): Added set and clear of CHANNEL_TIMER_FEV.
* generic/tclIO.h (CHANNEL_TIMER_FEV): New flag for channels. Is
set if a fileevent was generated by a timer, the channel is not
blocking and the driver did not provide a blockmodeproc. In that
case the I/O core has to be especially careful about going to
the driver for more data.
FossilOrigin-Name: cd08453fb35b917ed3a857ce9eff8e7d4c991bb2
Diffstat (limited to 'generic/tclIO.h')
-rw-r--r-- | generic/tclIO.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/generic/tclIO.h b/generic/tclIO.h index caac702..2465fba 100644 --- a/generic/tclIO.h +++ b/generic/tclIO.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.h,v 1.3 2001/03/30 23:06:40 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.h,v 1.4 2001/09/27 02:12:19 andreas_kupries Exp $ */ /* @@ -296,6 +296,17 @@ typedef struct ChannelState { * the state of the channel changes. */ #define CHANNEL_RAW_MODE (1<<16) /* When set, notes that the Raw API is * being used. */ +#define CHANNEL_TIMER_FEV (1<<17) /* When set the event we are + * notified by is a fileevent + * generated by a timer. We + * don't know if the driver + * has more data and should + * not try to read from it. If + * the system needs more than + * is in the buffers out read + * routines will simulate a + * short read (0 characters + * read) */ /* * For each channel handler registered in a call to Tcl_CreateChannelHandler, |