Description
At the moment, there are three possible configurations for rustix on linux:
libc
.linux-raw-sys
with the "std" feature.linux-raw-sys
without the "std" feature.
It's not currently feasible to support all three configurations, at least when the "std" feature in rustix
is enabled.
rustix::ffi::c_char
will always be the same ascore::ffi::c_char
(given that the "std" feature is enabled in rustix).linux_raw_sys::ctypes::c_char
will bei8
oru8
depending on the platform and whether or not "std" is enabled.
If I use linux_raw_sys::ctypes::c_char
in my project (xattr
) when, e.g., calling rustix::fs::listxattr
, I'm able to support the linux-raw-sys
backend both with and without the "linux-raw-sys/std" feature, but the libc
backend won't work as expected. If, instead, I use rustix::ffi::c_char
, I can support the libc
and linux-raw-sys
backends when the "linux-raw-sys/std" feature is enabled (explicitly, see #945 because it's not enabled by default) but the linux-raw-sys
backend won't work without said feature.
So ether:
rustix
needs to re-export the correctc_char
. E.g.,rustix::ffi::c_char
needs to belinux_raw_sys::ctypes::c_char
when thelinux_raw_sys
backend is in use.linux_raw_sys
needs to usecore::ffi::c_char
.
Ideally the second option for maximum compatibility.