Manual Pages for UNIX Darwin command on man setutxent
MyWebUniversity

Manual Pages for UNIX Darwin command on man setutxent

ENDUTXENT(3) BSD Library Functions Manual ENDUTXENT(3)

NAME

eenndduuttxxeenntt, ggeettuuttxxeenntt, ggeettuuttxxiidd, ggeettuuttxxlliinnee, ppuuttuuttxxlliinnee, sseettuuttxxeenntt - user

accounting database functions LLIIBBRRAARRYY

Standard C Library (libc, -lc)

SYNOPSIS

##iinncclluuddee <>

void eenndduuttxxeenntt(void); struct utmpx * ggeettuuttxxeenntt(void); struct utmpx * ggeettuuttxxiidd(const struct utmpx *); struct utmpx * ggeettuuttxxlliinnee(const struct utmpx *); struct utmpx * ppuuttuuttxxlliinnee(const struct utmpx *); void sseettuuttxxeenntt(void);

DESCRIPTION

These functions provide access to the utmpx(5) user accounting database. ggeettuuttxxeenntt() reads the next entry from the database; if the database was not yet open, it also opens it. sseettuuttxxeenntt() resets the database, so that the next ggeettuuttxxeenntt() call will get the first entry. eenndduuttxxeenntt() closes the database. ggeettuuttxxiidd() returns the next entry of the type specified in its argument's uttype field, or NULL if none is found. ggeettuuttxxlliinnee() returns the next LOGINPROCESS or USERPROCESS entry which has the same name as specified in the utline field, or NULL if no match is found. ppuuttuuttxxlliinnee() adds the argument utmpx(5) entry line to the accounting database, replacing a previous entry for the same user if it exists. The utmpx structure The uuttmmppxx structure has the following definition: struct utmpx { char utuser[UTXUSERSIZE]; /* login name */ char utid[UTXIDSIZE]; /* id */ char utline[UTXLINESIZE]; /* tty name */ pidt utpid; /* process id creating the entry */ short uttype; /* type of this entry */ struct timeval uttv; /* time entry was created */ char uthost[UTXHOSTSIZE]; /* host name */ uint32t utpad[16]; /* reserved for future use */ }; Valid entries for uttype are: BOOTTIME Time of a system boot. DEADPROCESS A session leader exited. EMPTY No valid user accounting information. INITPROCESS A process spawned by init(8).

LOGINPROCESS The session leader of a logged-in user.

NEWTIME Time after system clock change. OLDTIME Time before system clock change. RUNLVL Run level. Provided for compatibility, not used. USERPROCESS A user process.

RETURN VALUES

ggeettuuttxxeenntt() returns the next entry, or NULL on failure (end of database or problems reading from the database). ggeettuuttxxiidd() and ggeettuuttxxlliinnee() return the matching structure on success, or NULL if no match was found. ppuuttuuttxxlliinnee() returns the structure that was successfully written, or NULL.

SEE ALSO

utmpx(5) STANDARDS The eenndduuttxxeenntt(), ggeettuuttxxeenntt(), ggeettuuttxxiidd(), ggeettuuttxxlliinnee(), ppuuttuuttxxlliinnee(),

sseettuuttxxeenntt() all conform to IEEE Std 1003.1-2001 (``POSIX.1'') (XSI exten-

sion), and previously to X/Open Portability Guide Issue 4, Version 2 (``XPG4.2''). The fields utuser, utid, utline, utpid, uttype, and

uttv conform to IEEE Std 1003.1-2001 (``POSIX.1'') (XSI extension), and

previously to X/Open Portability Guide Issue 4, Version 2 (``XPG4.2''). BSD July 13, 2004 BSD




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™