Aargh! We were setting the VMIN and VTIME values in the termios
structure when the terminal is in non-raw mode, rather than raw mode,
because I had a test round the wrong way.
Apparently on Linux VMIN and VTIME default to 1/0, so it apparently
worked properly, but on Solaris the VMIN slot in the c_cc array is
shared with the VEOF slot, which meant that VMIN was being left as 4
(the value of ^D, which is the default contents of VEOF).
Thanks to Hal Daume for reporting the bug, and Malcolm Wallce &
Lennart Augustsson for helping to point me in the right direction.
MERGE TO STABLE
poke_c_lflag p_tios (new_c_lflag :: CTcflag)
-- set VMIN & VTIME to 1/0 respectively
- when cooked $ do
+ when (not cooked) $ do
c_cc <- ptr_c_cc p_tios
let vmin = (c_cc `plusPtr` (fromIntegral const_vmin)) :: Ptr Word8
vtime = (c_cc `plusPtr` (fromIntegral const_vtime)) :: Ptr Word8