File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ mod ffi {
22
22
extern {
23
23
pub fn cfgetispeed ( termios : * const Termios ) -> speed_t ;
24
24
pub fn cfgetospeed ( termios : * const Termios ) -> speed_t ;
25
+ pub fn cfmakeraw ( termios : * mut Termios ) ;
26
+ pub fn cfsetspeed ( termios : * mut Termios , speed : speed_t ) -> c_int ;
25
27
pub fn cfsetispeed ( termios : * mut Termios , speed : speed_t ) -> c_int ;
26
28
pub fn cfsetospeed ( termios : * mut Termios , speed : speed_t ) -> c_int ;
27
29
pub fn tcgetattr ( fd : c_int , termios : * mut Termios ) -> c_int ;
@@ -599,6 +601,18 @@ pub fn cfgetospeed(termios: &Termios) -> BaudRate {
599
601
}
600
602
}
601
603
604
+ pub fn cfmakeraw ( termios : & mut Termios ) {
605
+ unsafe {
606
+ ffi:: cfmakeraw ( termios) ;
607
+ }
608
+ }
609
+
610
+ pub fn cfsetspeed ( termios : & mut Termios , baud : BaudRate ) -> Result < ( ) > {
611
+ Errno :: result ( unsafe {
612
+ ffi:: cfsetspeed ( termios, baud as speed_t )
613
+ } ) . map ( drop)
614
+ }
615
+
602
616
pub fn cfsetispeed ( termios : & mut Termios , baud : BaudRate ) -> Result < ( ) > {
603
617
Errno :: result ( unsafe {
604
618
ffi:: cfsetispeed ( termios, baud as speed_t )
You can’t perform that action at this time.
0 commit comments