bcachefs-tools/bch_bindgen/src
Thomas Bertschinger 25e84a9917 rust: use libc::Ioctl type for ioctl() request argument
The second argument to ioctl() can be defined as a different type by
different libc implementations, and can be a different size on different
architectures depending on what type it is defined as. For example,
glibc defines it as `unsigned long` which may have a different size on
32-bit vs. 64-bit architectures, and musl libc defines it as `int`.

The Rust libc crate exposes a type `libc::Ioctl` which is defined as the
appropriate integer type for the given libc implementation. Using this
type for the request argument to `libc::ioctl()` ensures code will
compile correctly regardless of architecture and libc implementation.

Also, because ioctl request numbers are defined to be 32 bits
(regardless of the fact that `unsigned long` might sometimes take 64
bits on some architectures), this patch changes the Rust representation
of the bcachefs ioctl numbers to u32 instead of u64.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-20 22:27:19 -05:00
..
bcachefs.rs use upstream bindgen; fix packed and aligned types 2024-01-23 13:08:12 -05:00
bkey.rs move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
btree.rs move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
errcode.rs move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
fs.rs move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
keyutils_wrapper.h move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
keyutils.rs move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
lib.rs printbuf_to_formatter: Lossy display of non-UTF-8 printbufs 2024-01-29 14:34:24 +01:00
libbcachefs_wrapper.h rust: use libc::Ioctl type for ioctl() request argument 2024-02-20 22:27:19 -05:00
opts.rs move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
sb_io.rs Remove gag usage 2024-01-20 22:32:00 -05:00