#linux #uapi #ffi

no-std linux-raw-sys

Generated bindings for Linux's userspace API

56 releases

0.3.0 Feb 28, 2023
0.2.1 Jan 13, 2023
0.1.4 Dec 13, 2022
0.1.3 Nov 22, 2022
0.0.18 Jul 30, 2021

#65 in Unix APIs

Download history 311802/week @ 2022-12-05 343566/week @ 2022-12-12 335915/week @ 2022-12-19 225378/week @ 2022-12-26 322955/week @ 2023-01-02 413237/week @ 2023-01-09 423881/week @ 2023-01-16 444976/week @ 2023-01-23 470486/week @ 2023-01-30 478431/week @ 2023-02-06 501007/week @ 2023-02-13 515464/week @ 2023-02-20 691213/week @ 2023-02-27 736029/week @ 2023-03-06 830654/week @ 2023-03-13 1005738/week @ 2023-03-20

3,329,621 downloads per month
Used in 12,680 crates (3 directly)


133K SLoC


Generated bindings for Linux's userspace API

Github Actions CI Status zulip chat crates.io page docs.rs docs

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.

Minimum Supported Rust Version (MSRV)

This crate currently works on the version of [Rust on Debian stable], which is currently Rust 1.48. This policy may change in the future, in minor version releases, so users using a fixed version of Rust should pin to a specific version of this crate.