3 releases

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

#264 in Build Utils

Download history 26551/week @ 2024-06-19 25799/week @ 2024-06-26 38976/week @ 2024-07-03 41080/week @ 2024-07-10 30130/week @ 2024-07-17 37441/week @ 2024-07-24 18164/week @ 2024-07-31 7090/week @ 2024-08-07 6617/week @ 2024-08-14 10641/week @ 2024-08-21 8091/week @ 2024-08-28 10023/week @ 2024-09-04 10801/week @ 2024-09-11 6494/week @ 2024-09-18 8888/week @ 2024-09-25 9182/week @ 2024-10-02

37,604 downloads per month
Used in 18 crates (9 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
~55K SLoC