[go: up one dir, main page]

Module utmpx

Module utmpx 

Source
Expand description

Aims to provide platform-independent methods to obtain login records

ONLY support linux, macos and freebsd for the time being

§Examples:

use uucore::utmpx::Utmpx;
for ut in Utmpx::iter_all_records() {
    if ut.is_user_process() {
        println!("{}: {}", ut.host(), ut.user())
    }
}

Specifying the path to login record:

use uucore::utmpx::Utmpx;
for ut in Utmpx::iter_all_records_from("/some/where/else") {
    if ut.is_user_process() {
        println!("{}: {}", ut.host(), ut.user())
    }
}

Re-exports§

pub extern crate time;

Structs§

Utmpx
A login record
UtmpxIter
Iterator of login records

Enums§

UtmpxRecord
Wrapper type that can hold either traditional utmpx records or systemd records

Constants§

ACCOUNTING
BOOT_TIME
DEAD_PROCESS
EMPTY
INIT_PROCESS
LOGIN_PROCESS
NEW_TIME
OLD_TIME
RUN_LVL
USER_PROCESS
UT_HOSTSIZE
UT_IDSIZE
UT_LINESIZE
UT_NAMESIZE

Statics§

DEFAULT_FILE

Functions§

endutxent
getutxent
setutxent
utmpxname