Merge branch 'termios_cfsetspeed_shortcut' into 'master'

termios adding cfsetspeed bsd extension which set both __c_ispeed/__c_ospeed fields

See merge request redox-os/relibc!385
This commit is contained in:
Jeremy Soller
2023-05-05 19:45:10 +00:00
+9
View File
@@ -145,6 +145,15 @@ pub unsafe extern "C" fn cfsetospeed(termios_p: *mut termios, speed: speed_t) ->
-1
}
#[no_mangle]
pub unsafe extern "C" fn cfsetspeed(termios_p: *mut termios, speed: speed_t) -> c_int {
let r = cfsetispeed(termios_p, speed);
if r < 0 {
return r;
}
cfsetospeed(termios_p, speed)
}
#[no_mangle]
pub unsafe extern "C" fn tcflush(fd: c_int, queue: c_int) -> c_int {
sys_ioctl::ioctl(fd, sys_ioctl::TCFLSH, queue as *mut c_void)