Skip to content

Commit a3009e4

Browse files
authored
Merge pull request RustPython#3675 from fanninpm/more-termios-functions
Add more termios functions
2 parents bfb5e93 + fad9d87 commit a3009e4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

stdlib/src/termios.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,30 @@ mod termios {
232232
Ok(())
233233
}
234234

235+
#[pyfunction]
236+
fn tcsendbreak(fd: i32, duration: i32, vm: &VirtualMachine) -> PyResult<()> {
237+
termios::tcsendbreak(fd, duration).map_err(|e| termios_error(e, vm))?;
238+
Ok(())
239+
}
240+
241+
#[pyfunction]
242+
fn tcdrain(fd: i32, vm: &VirtualMachine) -> PyResult<()> {
243+
termios::tcdrain(fd).map_err(|e| termios_error(e, vm))?;
244+
Ok(())
245+
}
246+
247+
#[pyfunction]
248+
fn tcflush(fd: i32, queue: i32, vm: &VirtualMachine) -> PyResult<()> {
249+
termios::tcflush(fd, queue).map_err(|e| termios_error(e, vm))?;
250+
Ok(())
251+
}
252+
253+
#[pyfunction]
254+
fn tcflow(fd: i32, action: i32, vm: &VirtualMachine) -> PyResult<()> {
255+
termios::tcflow(fd, action).map_err(|e| termios_error(e, vm))?;
256+
Ok(())
257+
}
258+
235259
fn termios_error(err: std::io::Error, vm: &VirtualMachine) -> PyBaseExceptionRef {
236260
vm.new_exception(
237261
error_type(vm),

0 commit comments

Comments
 (0)