Skip to content

Commit 07904d8

Browse files
committed
Add cfmakeraw and cfsetspeed
1 parent d722d14 commit 07904d8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/sys/termios.rs

+12
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ pub fn cfgetospeed(termios: &Termios) -> BaudRate {
267267
}
268268
}
269269

270+
pub fn cfmakeraw(termios: &mut Termios) {
271+
unsafe {
272+
libc::cfmakeraw(&mut termios.termios);
273+
}
274+
}
275+
270276
pub fn cfsetispeed(termios: &mut Termios, baud: BaudRate) -> Result<()> {
271277
Errno::result(unsafe {
272278
libc::cfsetispeed(&mut termios.termios, baud as speed_t)
@@ -279,6 +285,12 @@ pub fn cfsetospeed(termios: &mut Termios, baud: BaudRate) -> Result<()> {
279285
}).map(drop)
280286
}
281287

288+
pub fn cfsetspeed(termios: &mut Termios, baud: BaudRate) -> Result<()> {
289+
Errno::result(unsafe {
290+
libc::cfsetspeed(&mut termios.termios, baud as speed_t)
291+
}).map(drop)
292+
}
293+
282294
pub fn tcgetattr(fd: RawFd) -> Result<Termios> {
283295
let mut termios: Termios = unsafe { mem::uninitialized() };
284296

0 commit comments

Comments
 (0)