File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -835,8 +835,10 @@ extern {
835835 pub fn tcdrain ( fd : :: c_int ) -> :: c_int ;
836836 pub fn cfgetispeed ( termios : * const :: termios ) -> :: speed_t ;
837837 pub fn cfgetospeed ( termios : * const :: termios ) -> :: speed_t ;
838+ pub fn cfmakeraw ( termios : * mut :: termios ) ;
838839 pub fn cfsetispeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
839840 pub fn cfsetospeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
841+ pub fn cfsetspeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
840842 pub fn tcgetattr ( fd : :: c_int , termios : * mut :: termios ) -> :: c_int ;
841843 pub fn tcsetattr ( fd : :: c_int ,
842844 optional_actions : :: c_int ,
Original file line number Diff line number Diff line change @@ -752,6 +752,16 @@ f! {
752752 pub fn cfgetospeed( termios: * const :: termios) -> :: speed_t {
753753 ( * termios) . c_cflag & :: CBAUD
754754 }
755+ pub fn cfmakeraw( termios: * mut :: termios) -> ( ) {
756+ ( * termios) . c_iflag &= !( :: IGNBRK | :: BRKINT | :: PARMRK | :: ISTRIP |
757+ :: INLCR | :: IGNCR | :: ICRNL | :: IXON ) ;
758+ ( * termios) . c_oflag &= !:: OPOST ;
759+ ( * termios) . c_lflag &= !( :: ECHO | :: ECHONL | :: ICANON | :: ISIG |
760+ :: IEXTEN ) ;
761+ ( * termios) . c_cflag &= !( :: CSIZE | :: PARENB ) ;
762+ ( * termios) . c_cflag |= :: CS8 ;
763+ ( )
764+ }
755765 pub fn cfsetispeed( termios: * mut :: termios, speed: :: speed_t) -> :: c_int {
756766 let cbaud = :: CBAUD ;
757767 ( * termios) . c_cflag = ( ( * termios) . c_cflag & !cbaud) | ( speed & cbaud) ;
@@ -762,6 +772,11 @@ f! {
762772 ( * termios) . c_cflag = ( ( * termios) . c_cflag & !cbaud) | ( speed & cbaud) ;
763773 return 0
764774 }
775+ pub fn cfsetspeed( termios: * mut :: termios, speed: :: speed_t) -> :: c_int {
776+ let cbaud = :: CBAUD ;
777+ ( * termios) . c_cflag = ( ( * termios) . c_cflag & !cbaud) | ( speed & cbaud) ;
778+ return 0
779+ }
765780 pub fn tcgetattr( fd: :: c_int, termios: * mut :: termios) -> :: c_int {
766781 ioctl( fd, :: TCGETS , termios)
767782 }
You can’t perform that action at this time.
0 commit comments