2 releases

0.0.1-pre+5.4.0 Jan 30, 2020
0.0.0 Dec 25, 2019

#4 in #uapi


60 lines

linux-sys - raw auto generated FFI bindings to Linux UAPI headers

Build Status Latest version License dependency status License

linux-sys provides the correct headers to access linux user-api directly.
All the types in this crate are autogenerated at compile time and will have different types per platform. The fact that you see type Foo = u8 doesn't mean you can just use u8, you have to use Foo as on some platforms it might be i8 or u32.

Please open issues if there's any typedef/struct missing that you'd like (currently contains only the major headers for technical reasons https://sourceware.org/glibc/wiki/Synchronizing_Headers)

Note this aren't necessarily libc compatible, and if you need to work with lib please see the libc crate.


The versions in this crate match the Linux Kernel version that was used to generate the headers.

Add this to your Cargo.toml:

linux-sys = "5.4"


  • cty - By default std::os::raw is used to get C fundamental types(e.g. long, int etc.) the cty feature replaces libstd with cty crate

Minimum Supported Rust Version (MSRV)

Currently it officially supports only rust nightly, because most interaction with the kernel requires assembly anyway. In practice both beta and stable are tested in the CI. but I do plan to add an autodetect feature to bindgen] such that it will work with whatever version bindgen] can generate for.