MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / cfmakeraw

Function cfmakeraw

src/backend/libc/termios/syscalls.rs:495–510  ·  view source on GitHub ↗
(termios: &mut Termios)

Source from the content-addressed store, hash-verified

493#[cfg(not(any(target_os = "espidf", target_os = "nto", target_os = "wasi")))]
494#[inline]
495pub(crate) fn cfmakeraw(termios: &mut Termios) {
496 unsafe {
497 // On AIX, cfmakeraw() has a return type of 'int' instead of 'void'.
498 // If the argument 'termios' is NULL, it returns -1; otherwise, it returns 0.
499 // We believe it is safe to ignore the return value.
500 #[cfg(target_os = "aix")]
501 {
502 let _ = c::cfmakeraw(as_mut_ptr(termios).cast());
503 }
504
505 #[cfg(not(target_os = "aix"))]
506 {
507 c::cfmakeraw(as_mut_ptr(termios).cast());
508 }
509 }
510}
511
512pub(crate) fn isatty(fd: BorrowedFd<'_>) -> bool {
513 // Use the return value of `isatty` alone. We don't check `errno` because

Callers 1

make_rawMethod · 0.50

Calls 1

as_mut_ptrFunction · 0.85

Tested by

no test coverage detected