uname: don't report OS as "GNU/Linux" without GNU

The `uname` `-o` switch reports the operating system used. If the GNU C
standard library (glibc) is not in use, for example if musl is being
used instead, report "Linux" instead of "GNU/Linux".
This commit is contained in:
Dave Hodder 2021-07-05 22:42:42 +01:00
parent 41d289377b
commit c74b77aec8

View file

@ -30,8 +30,10 @@ pub mod options {
pub static OS: &str = "operating-system";
}
#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "")))]
const HOST_OS: &str = "GNU/Linux";
#[cfg(all(target_os = "linux", not(any(target_env = "gnu", target_env = ""))))]
const HOST_OS: &str = "Linux";
#[cfg(target_os = "windows")]
const HOST_OS: &str = "Windows NT";
#[cfg(target_os = "freebsd")]