diff --git a/src/header/termios/mod.rs b/src/header/termios/mod.rs index 9ec23f7653..ffd1e94c10 100644 --- a/src/header/termios/mod.rs +++ b/src/header/termios/mod.rs @@ -91,6 +91,10 @@ pub struct termios { pub c_lflag: tcflag_t, /// Control characters. pub c_cc: [cc_t; NCCS], + /// Input baud rate (non-POSIX; B0..=B4000000). + pub __c_ispeed: speed_t, + /// Output baud rate (non-POSIX; B0..=B4000000). + pub __c_ospeed: speed_t, } /// See . @@ -171,8 +175,7 @@ pub unsafe extern "C" fn cfgetispeed(termios_p: *const termios) -> speed_t { } #[cfg(target_os = "redox")] { - //TODO - 0 + unsafe { (*termios_p).__c_ispeed } } } @@ -193,8 +196,7 @@ pub unsafe extern "C" fn cfgetospeed(termios_p: *const termios) -> speed_t { } #[cfg(target_os = "redox")] { - //TODO - 0 + unsafe { (*termios_p).__c_ospeed } } } @@ -208,8 +210,6 @@ pub unsafe extern "C" fn cfgetospeed(termios_p: *const termios) -> speed_t { #[unsafe(no_mangle)] pub unsafe extern "C" fn cfsetispeed(termios_p: *mut termios, speed: speed_t) -> c_int { match speed as usize { - // TODO redox impl - #[cfg(target_os = "linux")] B0..=B38400 | B57600..=B4000000 => { unsafe { (*termios_p).__c_ispeed = speed }; 0 @@ -231,8 +231,6 @@ pub unsafe extern "C" fn cfsetispeed(termios_p: *mut termios, speed: speed_t) -> #[unsafe(no_mangle)] pub unsafe extern "C" fn cfsetospeed(termios_p: *mut termios, speed: speed_t) -> c_int { match speed as usize { - // TODO redox impl - #[cfg(target_os = "linux")] B0..=B38400 | B57600..=B4000000 => { unsafe { (*termios_p).__c_ospeed = speed }; 0