Crates.io | glibc_musl_version |
lib.rs | glibc_musl_version |
version | 0.1.0 |
created_at | 2025-09-06 17:32:24.354429+00 |
updated_at | 2025-09-06 17:32:24.354429+00 |
description | A small crate to detect glibc and musl versions from the running system |
homepage | https://github.com/qarmin/glibc_musl_version |
repository | https://github.com/qarmin/glibc_musl_version |
max_upload_size | |
id | 1827274 |
size | 17,694 |
A Rust library for detecting the installed glibc or musl version on Linux systems.
Similar to glibc_version crate, but it supports also musl and have 0 additional dependencies.
Add to your Cargo.toml
:
[dependencies]
glibc_musl_version = "0.1"
Example usage(you can run it via cargo run --example print_libc
):
use glibc_musl_version::get_os_libc_versions;
fn main() {
match get_os_libc_versions() {
Ok(versions) => println!("glibc/musl: {versions}"),
Err(e) => eprintln!("Error: {e}"),
}
}
I wanted also to get the version of libc used by the binary (because not always the system libc is used), but I didn't find any reliable and fast way to do it. If I find a good method, I will try to add it in the future.