Skip to content
Snippets Groups Projects
  • Joshua M. Clulow's avatar
    5b6a3335
    fix cfmakeraw() for illumos and Solaris · 5b6a3335
    Joshua M. Clulow authored
    This change fixes two issues.  First, the current cfmakeraw()
    implementation in this crate appears to be making a stack copy of the
    input "struct termios" before modifying it, rather than correctly
    modifying the original through the pointer.  Before this modification
    the routine did not, thus, set the flags for raw mode.
    
    Second, we address the default settings of the MIN and TIME terminal
    options.  On at least FreeBSD and Linux systems, the modern default
    value for MIN appears to be 1; i.e., block and wait for at least one
    input byte.  On most Solaris and illumos systems, the MIN control
    character slot overlaps with EOF, and thus has a default value of 4.
    This breaks at least the examples in the "termion" crate, and probably
    quite a lot of other software written first and foremost for Linux
    systems.  We need to force the MIN value to 1 while switching to raw
    mode.
    5b6a3335
    History
    fix cfmakeraw() for illumos and Solaris
    Joshua M. Clulow authored
    This change fixes two issues.  First, the current cfmakeraw()
    implementation in this crate appears to be making a stack copy of the
    input "struct termios" before modifying it, rather than correctly
    modifying the original through the pointer.  Before this modification
    the routine did not, thus, set the flags for raw mode.
    
    Second, we address the default settings of the MIN and TIME terminal
    options.  On at least FreeBSD and Linux systems, the modern default
    value for MIN appears to be 1; i.e., block and wait for at least one
    input byte.  On most Solaris and illumos systems, the MIN control
    character slot overlaps with EOF, and thus has a default value of 4.
    This breaks at least the examples in the "termion" crate, and probably
    quite a lot of other software written first and foremost for Linux
    systems.  We need to force the MIN value to 1 while switching to raw
    mode.
compat.rs 1.65 KiB