Files
Dan Gohman 1b7dfcdda0 Add tests to ensure that the C type definitions match libc. (#27)
* Add tests to ensure that the C type definitions match libc.

In no-std mode, we don't depend on libc. But, we still want to be sure
that our types match those of libc. This adds a libc dev-dependency and
checks that the types are the same in cargo-test.

* Use `cargo check --tests` instead of `cargo test`.

We only have static-assertion tests, and `cargo check --tests` is enough
for those, and doesn't require installing cross-compilers.
2022-02-16 10:24:12 -08:00

2.1 KiB

linux-raw-sys

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.