Skip to main content

Module who

Module who 

Source

Structs§

UtmpxEntry
A decoded utmpx entry.
WhoConfig
Configuration for the who command, derived from CLI flags.

Functions§

current_tty
Get the terminal device for the current process (for “who am i” / -m).
format_count
Format output for the -q / –count mode.
format_entry
Format a single utmpx entry as an output line.
format_heading
Format heading line.
format_time
Format a Unix timestamp as “YYYY-MM-DD HH:MM”.
read_utmpx
Read all utmpx entries from the system database.
read_utmpx_with_systemd_fallback
Read utmpx with systemd fallback, checking PIDs (for who/users).
read_utmpx_with_systemd_fallback_ex
Read utmpx entries, falling back to systemd sessions if the utmpx database has no USER_PROCESS entries. This matches GNU coreutils behavior: when /var/run/utmp is absent or empty, use systemd-logind session files.
read_utmpx_with_systemd_fallback_no_pid_check
Read utmpx with systemd fallback, without PID checking (for pinky).
run_who
Run the who command and return the formatted output.
should_show
Check if an entry should be displayed given the config.