1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

add musl utmpx limitation to --help texts

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
This commit is contained in:
Etienne Cordonnier 2025-04-15 11:45:04 +02:00
parent 0354f1f84d
commit bc8acbb6db
4 changed files with 40 additions and 0 deletions

View file

@ -10,7 +10,18 @@ use uucore::{format_usage, help_about, help_usage};
mod platform;
#[cfg(target_env = "musl")]
const ABOUT: &str = concat!(
help_about!("pinky.md"),
"\n\nWarning: When built with musl libc, the `pinky` utility may show incomplete \n",
"or missing user information due to musl's stub implementation of `utmpx` \n",
"functions. This limitation affects the ability to retrieve accurate details \n",
"about logged-in users."
);
#[cfg(not(target_env = "musl"))]
const ABOUT: &str = help_about!("pinky.md");
const USAGE: &str = help_usage!("pinky.md");
mod options {

View file

@ -23,7 +23,17 @@ use uucore::{format_usage, help_about, help_usage};
#[cfg(not(target_os = "openbsd"))]
use uucore::utmpx::*;
#[cfg(target_env = "musl")]
const ABOUT: &str = concat!(
help_about!("uptime.md"),
"\n\nWarning: When built with musl libc, the `uptime` utility may show '0 users' \n",
"due to musl's stub implementation of utmpx functions. Boot time and load averages \n",
"are still calculated using alternative mechanisms."
);
#[cfg(not(target_env = "musl"))]
const ABOUT: &str = help_about!("uptime.md");
const USAGE: &str = help_usage!("uptime.md");
pub mod options {
pub static SINCE: &str = "since";

View file

@ -18,7 +18,16 @@ use utmp_classic::{UtmpEntry, parse_from_path};
#[cfg(not(target_os = "openbsd"))]
use uucore::utmpx::{self, Utmpx};
#[cfg(target_env = "musl")]
const ABOUT: &str = concat!(
help_about!("users.md"),
"\n\nWarning: When built with musl libc, the `users` utility may show '0 users' \n",
"due to musl's stub implementation of utmpx functions."
);
#[cfg(not(target_env = "musl"))]
const ABOUT: &str = help_about!("users.md");
const USAGE: &str = help_usage!("users.md");
#[cfg(target_os = "openbsd")]

View file

@ -28,7 +28,17 @@ mod options {
pub const FILE: &str = "FILE"; // if length=1: FILE, if length=2: ARG1 ARG2
}
#[cfg(target_env = "musl")]
const ABOUT: &str = concat!(
help_about!("who.md"),
"\n\nNote: When built with musl libc, the `who` utility will not display any \n",
"information about logged-in users. This is due to musl's stub implementation \n",
"of `utmpx` functions, which prevents access to the necessary data."
);
#[cfg(not(target_env = "musl"))]
const ABOUT: &str = help_about!("who.md");
const USAGE: &str = help_usage!("who.md");
#[cfg(target_os = "linux")]