Hello, I'm having issues using the serial library in ARM. The thing is that in the library, here it does the following:
let cstr = match CString::new(path.as_os_str().as_bytes())
Ok(s) => s,
Err(_) => return Err(super::error::from_raw_os_error(EINVAL))
};
let fd = unsafe { libc::open(cstr.as_ptr(), O_RDWR | O_NOCTTY | O_NONBLOCK, 0) };
Which works fine in x86_64, but I get the following error when compiling for ARM:
Compiling serial v0.3.2 (file:///home/razican/workspace/serial-rs)
src/posix/tty.rs:59:24: 59:50 error: mismatched types:
expected `*const i8`,
found `*const u8`
(expected i8,
found u8) [E0308]
src/posix/tty.rs:59 libc::open(cstr.as_ptr() as *const u8,
^~~~~~~~~~~~~~~~~~~~~~~~~~
src/posix/tty.rs:59:24: 59:50 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
Could not compile `serial`.
The documentation does not really show anything, since seems that ARM and x86_64 are switched or something. Here in ARM says a c_char should be a u8: https://doc.rust-lang.org/libc/arm-unknown-linux-gnueabihf/libc/type.c_char.html But in my compilation it seems c_char is i8.
What can I do to fix it?