ENDUTXENT(3) | Library Functions Manual | ENDUTXENT(3) |
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);
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.
struct utmpx { char ut_name[_UTX_USERSIZE]; /* login name */ char ut_id[_UTX_IDSIZE]; /* inittab id */ char ut_line[_UTX_LINESIZE]; /* tty name */ char ut_host[_UTX_HOSTSIZE]; /* host name */ uint16_t ut_session; /* session id used for windowing */ uint16_t ut_type; /* type of this entry */ pid_t ut_pid; /* process id creating the entry */ struct { uint16_t e_termination; /* process termination signal */ uint16_t e_exit; /* process exit status */ } ut_exit; struct sockaddr_storage ut_ss; /* address where entry was made from */ struct timeval ut_tv; /* time entry was created */ uint32_t ut_pad[10]; /* reserved for future use */ };
Valid entries for ut_type are:
September 26, 2002 | NetBSD 6.1 |