Standard C Library (libc, -lc)
SYNOPSIS
#include <utmpx.h>
void
endutxent(void);
struct utmpx *
getutxent(void);
struct utmpx *
getutxid(const struct utmpx *);
struct utmpx *
getutxline(const struct utmpx *);
struct utmpx *
pututxline(const struct utmpx *);
void
setutxent(void);
DESCRIPTION
These functions provide access to the utmpx(5) user accounting database.
getutxent() reads the next entry from the database; if the database was
not yet open, it also opens it. setutxent() resets the database, so that
the next getutxent() call will get the first entry. endutxent() closes
the database.
getutxid() returns the next entry of the type specified in its argument's
ut_type field, or NULL if none is found. getutxline() returns the next
LOGIN_PROCESS or USER_PROCESS entry which has the same name as specified
in the ut_line field, or NULL if no match is found.
pututxline() 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 utmpx structure has the following definition:
struct utmpx {
char ut_user[_UTX_USERSIZE]; /* login name */
char ut_id[_UTX_IDSIZE]; /* id */
char ut_line[_UTX_LINESIZE]; /* tty name */
pid_t ut_pid; /* process id creating the entry */
short ut_type; /* type of this entry */
struct timeval ut_tv; /* time entry was created */
char ut_host[_UTX_HOSTSIZE]; /* host name */
__uint32_t ut_pad[16]; /* reserved for future use */
};
or problems reading from the database). getutxid() and getutxline()
return the matching structure on success, or NULL if no match was found.
pututxline() returns the structure that was successfully written, or
NULL.
SEE ALSO
utmpx(5)
STANDARDS
The endutxent(), getutxent(), getutxid(), getutxline(), pututxline(),
setutxent() 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 ut_user, ut_id, ut_line, ut_pid, ut_type, and
ut_tv 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
Man(1) output converted with
man2html
|