#libc #linux

nightly no-std c-scape

A libc bottom-half implementation in Rust

90 releases (20 breaking)

0.20.3 Nov 27, 2024
0.19.2 Oct 9, 2024
0.16.1 May 22, 2024
0.15.41 Feb 29, 2024
0.3.0 Nov 18, 2021

#28 in No standard library

Download history 173/week @ 2024-08-19 32/week @ 2024-08-26 16/week @ 2024-09-02 7/week @ 2024-09-09 16/week @ 2024-09-16 76/week @ 2024-09-23 588/week @ 2024-09-30 968/week @ 2024-10-07 467/week @ 2024-10-14 130/week @ 2024-10-21 44/week @ 2024-10-28 141/week @ 2024-11-04 27/week @ 2024-11-11 60/week @ 2024-11-18 267/week @ 2024-11-25 77/week @ 2024-12-02

440 downloads per month
Used in 6 crates (via c-gull)

Apache-2.0…

570KB
16K SLoC

Contains (static library, 1KB) empty/riscv64/libxnet.a, (static library, 1KB) empty/aarch64/libc.a, (static library, 1KB) empty/aarch64/libcrypt.a, (static library, 1KB) empty/aarch64/libdl.a, (static library, 1KB) empty/aarch64/libgcc.a, (static library, 1KB) empty/aarch64/libgcc_s.a and 54 more.

c-scape

A layer underneath c-gull

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

c-scape is a layer underneath c-gull. It provides a subset of libc features, containing only features that don't require Rust's std to implement. This allows it to be used by std itself.

This is currently highly experimental, incomplete, and some things aren't optimized. And it depends on Nightly Rust.

c-scape's two modes

Similar to c-gull, c-scape has "take-charge" and "coexist-with-libc" modes. One of these must be enabled.

In "take-charge" mode, c-scape takes charge of the process, handling program startup (via Origin) providing malloc (via c-scape), and other things. This requires some additional setup; see the c-scape-example example crate for more details.

In "coexist-with-libc" mode, c-scape can be used as a drop-in (partial) libc replacement. To use it, just change your typical libc dependency in Cargo.toml to this:

libc = { version = "<c-scape version>", package = "c-scape", features = ["coexist-with-libc"] }

Dependencies

~11–20MB
~368K SLoC