diff --git a/src/backend/libc/termios/syscalls.rs b/src/backend/libc/termios/syscalls.rs index e27f0b2e0..dbe4a6e03 100644 --- a/src/backend/libc/termios/syscalls.rs +++ b/src/backend/libc/termios/syscalls.rs @@ -493,7 +493,20 @@ pub(crate) fn set_input_speed(termios: &mut Termios, arbitrary_speed: u32) -> io #[cfg(not(any(target_os = "espidf", target_os = "nto", target_os = "wasi")))] #[inline] pub(crate) fn cfmakeraw(termios: &mut Termios) { - unsafe { c::cfmakeraw(as_mut_ptr(termios).cast()) } + unsafe { + // On AIX, cfmakeraw() has a return type of 'int' instead of 'void'. + // If the argument 'termios' is NULL, it returns -1; otherwise, it returns 0. + // We believe it is safe to ignore the return value. + #[cfg(target_os = "aix")] + { + let _ = c::cfmakeraw(as_mut_ptr(termios).cast()); + } + + #[cfg(not(target_os = "aix"))] + { + c::cfmakeraw(as_mut_ptr(termios).cast()); + } + } } pub(crate) fn isatty(fd: BorrowedFd<'_>) -> bool {