sys_ioctl: add Redox implementations for tcdrain, tcflow, and tcsendbreak

Strangely enough, the `dup_write` was already done for `tcflush`, but wasn't implemented in ptyd.
This commit is contained in:
Connor-GH
2026-07-07 16:49:57 -05:00
parent 3a44b63a9a
commit d465f3d34d
+12 -6
View File
@@ -103,6 +103,18 @@ pub unsafe fn ioctl_inner(fd: c_int, request: c_ulong, out: *mut c_void) -> Resu
let queue = out as c_int;
dup_write(fd, "flush", &queue)?;
}
// tcsendbreak() and tcdrain()
TCSBRK => {
// tcsendbreak == ioctl(TCSBRK, 0)
// tcdrain == ioctl(TCSBRK, <nonzero>)
let duration = out as c_int;
dup_write(fd, "sendbreak", &duration)?;
}
// tcflow()
TCXONC => {
let arg = out as c_int;
dup_write(fd, "flow", &arg)?;
}
TIOCSCTTY => {
todo_skip!(0, "ioctl TIOCSCTTY");
}
@@ -134,12 +146,6 @@ pub unsafe fn ioctl_inner(fd: c_int, request: c_ulong, out: *mut c_void) -> Resu
let name = unsafe { &mut *(out as *mut c_int) };
dup_read(fd, "ptsname", name)?;
}
TCSBRK => {
todo_skip!(0, "ioctl TCSBRK");
}
TCXONC => {
todo_skip!(0, "ioctl TCXONC");
}
SIOCATMARK => {
todo_skip!(0, "ioctl SIOCATMARK");
}