Merge branch 'tcsetwinsize' into 'master'
Adding tcsetwinsize See merge request redox-os/relibc!404
This commit is contained in:
@@ -21,6 +21,12 @@ pub struct winsize {
|
||||
ws_ypixel: c_ushort,
|
||||
}
|
||||
|
||||
impl winsize {
|
||||
pub fn get_row_col(&self) -> (c_ushort, c_ushort) {
|
||||
(self.ws_row, self.ws_col)
|
||||
}
|
||||
}
|
||||
|
||||
pub use self::sys::*;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
//! termios implementation, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/termios.h.html
|
||||
|
||||
use crate::{
|
||||
header::{errno, sys_ioctl},
|
||||
header::{
|
||||
errno,
|
||||
sys_ioctl::{self, winsize},
|
||||
},
|
||||
platform::{self, types::*},
|
||||
};
|
||||
|
||||
@@ -171,6 +174,11 @@ pub unsafe extern "C" fn tcsendbreak(fd: c_int, _dur: c_int) -> c_int {
|
||||
sys_ioctl::ioctl(fd, sys_ioctl::TCSBRK, 0 as *mut _)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn tcsetwinsize(fd: c_int, mut sws: winsize) -> c_int {
|
||||
sys_ioctl::ioctl(fd, sys_ioctl::TIOCSWINSZ, &mut sws as *mut _ as *mut c_void)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn tcflow(fd: c_int, action: c_int) -> c_int {
|
||||
// non-zero duration is ignored by musl due to it being
|
||||
|
||||
Reference in New Issue
Block a user