Originally, the idea of having multiple versions was to attempt to support writing code that was strictly compatible with old versions. However, my experience with linux-raw-sys so far as been that that's not as useful as it seemed like it would be, and versioning all the imports means having multiple versions of all the types, which gets awkward. So instead, switch to having just a single Linux version, 5.11 for now, which is mostly a superset of the other versions. This also helps reduce compile times, as there aren't multiple versions of everything to parse.
1.9 KiB
This crate contains bindgen-generated bindings for Linux's userspace API.
This is primarily of interest if you want to make raw system calls directly, which is tedious and error prone and not necessary for most use cases. For a minimal type-safe, memory-safe, and I/O-safe API to the Linux system calls built on these bindings, see the rustix crate.
The full bindings are quite large, so they've been split up into modules and
cargo features. By default, general and errno are enabled, which provide
most things needed by general-purpose code.
To regenerate the generated bindings, run cargo update && cd gen && cargo run --release.
Similar crates
This is similar to linux-sys, except the bindings are generated offline, rather than in a build.rs, making downstream builds simpler. And, this crate has bindings for more headers, as well as supplementary definitions not exported by Linux's headers but nonetheless needed by userspace.