3 releases

0.1.2 Mar 24, 2021
0.1.1 Mar 24, 2021
0.1.0 Mar 24, 2021

#251 in Build Utils

Download history 9201/week @ 2024-10-02 9615/week @ 2024-10-09 7837/week @ 2024-10-16 9047/week @ 2024-10-23 8734/week @ 2024-10-30 12658/week @ 2024-11-06 10680/week @ 2024-11-13 9116/week @ 2024-11-20 7737/week @ 2024-11-27 7326/week @ 2024-12-04 8942/week @ 2024-12-11 7798/week @ 2024-12-18 2061/week @ 2024-12-25 5273/week @ 2025-01-01 10446/week @ 2025-01-08 9913/week @ 2025-01-15

28,549 downloads per month
Used in 19 crates (10 directly)

Apache-2.0

5KB
74 lines

glibc_version

Crate to help rust projects discover GNU libc version at build time. Expected to be used in build.rs.

Usage

let ver = glibc_version::get_version().unwrap();
println!("glic version: {}.{}", ver.major, ver.minor);

lib.rs:

Crate to help rust projects discover GNU libc version at build time. Expected to be used in build.rs. Note that this crate is only expected to work under cfg(target_env = "gnu"), so please guard the usage under relevant configuration predicates.

Example

let ver = glibc_version::get_version().unwrap();
if ver.major >= 2 && ver.minor >= 28 {
   println!("cargo:rustc-cfg=glibc_renameat2");
}

Dependencies

~2.2–3MB
~54K SLoC