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

This commit is contained in:
David Carlier
2023-05-05 16:56:23 +01:00
parent 6d6e068beb
commit c2b00e8c6b
+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)