From d465f3d34dedecb666439bf9f0e67ea4c1dc1a62 Mon Sep 17 00:00:00 2001 From: Connor-GH Date: Tue, 7 Jul 2026 16:49:57 -0500 Subject: [PATCH] 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. --- src/header/sys_ioctl/redox/mod.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/header/sys_ioctl/redox/mod.rs b/src/header/sys_ioctl/redox/mod.rs index d678417dc9..c5100f5f67 100644 --- a/src/header/sys_ioctl/redox/mod.rs +++ b/src/header/sys_ioctl/redox/mod.rs @@ -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, ) + 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"); }