Skip to content

Commit 2c9d3e3

Browse files
committed
Add cfmakeraw and cfsetspeed
1 parent cfd813f commit 2c9d3e3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/sys/termios.rs

+10
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,12 @@ pub fn cfgetospeed(termios: &Termios) -> BaudRate {
264264
unsafe { libc::cfgetospeed(&termios.termios).into() }
265265
}
266266

267+
pub fn cfmakeraw(termios: &mut Termios) {
268+
unsafe {
269+
libc::cfmakeraw(&mut termios.termios);
270+
}
271+
}
272+
267273
pub fn cfsetispeed(termios: &mut Termios, baud: BaudRate) -> Result<()> {
268274
Errno::result(unsafe { libc::cfsetispeed(&mut termios.termios, baud as speed_t) }).map(drop)
269275
}
@@ -272,6 +278,10 @@ pub fn cfsetospeed(termios: &mut Termios, baud: BaudRate) -> Result<()> {
272278
Errno::result(unsafe { libc::cfsetospeed(&mut termios.termios, baud as speed_t) }).map(drop)
273279
}
274280

281+
pub fn cfsetspeed(termios: &mut Termios, baud: BaudRate) -> Result<()> {
282+
Errno::result(unsafe { libc::cfsetspeed(&mut termios.termios, baud as speed_t) }).map(drop)
283+
}
284+
275285
pub fn tcgetattr(fd: RawFd) -> Result<Termios> {
276286
let mut termios: Termios = unsafe { mem::uninitialized() };
277287

0 commit comments

Comments
 (0)