Crates.io | linux-sys |
lib.rs | linux-sys |
version | 0.0.1-pre+5.4.0 |
source | src |
created_at | 2019-12-25 12:36:40.716458 |
updated_at | 2020-01-30 16:23:52.15347 |
description | FFI bindings to linux UAPI |
homepage | |
repository | https://github.com/elichai/syscalls-rs/tree/master/linux-sys |
max_upload_size | 15728640 |
id | 192323 |
size | 45,042,910 |
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
:
[dependencies]
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
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.