Support TCSETSW and TCSETSF for ioctl

This commit is contained in:
Jianfeng Jiang
2023-06-14 16:40:27 +08:00
committed by Tate, Hongliang Tian
parent 3eab9cea6e
commit 0018ac4d63
3 changed files with 24 additions and 0 deletions

View File

@ -114,6 +114,21 @@ impl Device for Tty {
self.ldisc.set_termios(termios);
Ok(0)
}
IoctlCmd::TCSETSW => {
let termios = read_val_from_user(arg)?;
debug!("set termios = {:?}", termios);
self.ldisc.set_termios(termios);
// TODO: drain output buffer
Ok(0)
}
IoctlCmd::TCSETSF => {
let termios = read_val_from_user(arg)?;
debug!("set termios = {:?}", termios);
self.ldisc.set_termios(termios);
self.ldisc.drain_input();
// TODO: drain output buffer
Ok(0)
}
IoctlCmd::TIOCGWINSZ => {
// TODO:get window size
Ok(0)