| Line | |
|---|
| 1 | .TH UTMP 5
|
|---|
| 2 | .SH NAME
|
|---|
| 3 | utmp, wtmp \- logged in users, login and logout history
|
|---|
| 4 | .SH SYNOPSIS
|
|---|
| 5 | .nf
|
|---|
| 6 | .ft B
|
|---|
| 7 | #include <sys/types.h>
|
|---|
| 8 | #include <utmp.h>
|
|---|
| 9 | .SH DESCRIPTION
|
|---|
| 10 | .de SP
|
|---|
| 11 | .if t .sp 0.4
|
|---|
| 12 | .if n .sp
|
|---|
| 13 | ..
|
|---|
| 14 | The files
|
|---|
| 15 | .B /etc/utmp
|
|---|
| 16 | and
|
|---|
| 17 | .B /usr/adm/wtmp
|
|---|
| 18 | respectively contain the currently logged in users, and the history of
|
|---|
| 19 | logins and logouts.
|
|---|
| 20 | .PP
|
|---|
| 21 | Each file is an array of the following structure defined in <utmp.h>:
|
|---|
| 22 | .PP
|
|---|
| 23 | .nf
|
|---|
| 24 | .ta +5n +15n +15n
|
|---|
| 25 | struct utmp {
|
|---|
| 26 | char ut_user[8]; /* user name */
|
|---|
| 27 | char ut_line[12]; /* terminal name */
|
|---|
| 28 | char ut_host[16]; /* host name, when remote */
|
|---|
| 29 | time_t ut_time; /* login/logout time */
|
|---|
| 30 | };
|
|---|
| 31 | .SP
|
|---|
| 32 | .ta +15n
|
|---|
| 33 | #define ut_name ut_user /* for compatibility with other systems */
|
|---|
| 34 | .fi
|
|---|
| 35 | .DT
|
|---|
| 36 | .PP
|
|---|
| 37 | The structure contains more fields than those listed, but they are only of
|
|---|
| 38 | interest to
|
|---|
| 39 | .B init
|
|---|
| 40 | and
|
|---|
| 41 | .BR login .
|
|---|
| 42 | Note that the
|
|---|
| 43 | .B ut_name
|
|---|
| 44 | field is a compatibility alias for
|
|---|
| 45 | .BR ut_user ,
|
|---|
| 46 | it is actually better to use it.
|
|---|
| 47 | .PP
|
|---|
| 48 | A login entry is completely specified. A logout entry has a null string for
|
|---|
| 49 | .BR ut_name .
|
|---|
| 50 | A shutdown or reboot entry has an
|
|---|
| 51 | .B ut_line
|
|---|
| 52 | field containing a "~" (tilde). The
|
|---|
| 53 | .B ut_name
|
|---|
| 54 | field is usually the name of the program that did the shutdown, or "reboot"
|
|---|
| 55 | at reboot. This is a bit confusing, but note that there should always be
|
|---|
| 56 | two such entries. If you see just one entry then the system has crashed, if
|
|---|
| 57 | you see two entries then the system was properly shut down and later
|
|---|
| 58 | rebooted.
|
|---|
| 59 | .SH FILES
|
|---|
| 60 | .TP 25n
|
|---|
| 61 | .B /etc/utmp
|
|---|
| 62 | Currently logged in users.
|
|---|
| 63 | .TP
|
|---|
| 64 | .B /usr/adm/wtmp
|
|---|
| 65 | History of logins and logouts.
|
|---|
| 66 | .SH "SEE ALSO"
|
|---|
| 67 | .BR who (1),
|
|---|
| 68 | .BR ttyslot (3).
|
|---|
| 69 | .SH AUTHOR
|
|---|
| 70 | Kees J. Bot (kjb@cs.vu.nl)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.