1 .\" $NetBSD: utmp.5,v 1.5 1994/11/30 19:31:35 jtc Exp $
3 .\" Copyright (c) 1980, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\" must display the following acknowledgement:
16 .\" This product includes software developed by the University of
17 .\" California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" @(#)utmp.5 8.2 (Berkeley) 3/17/94
43 .Nd login records (DEPRECATED)
47 The interfaces in file
51 and are only provided for compatibility with previous releases of Mac OS X.
56 for the supported interfaces.
59 declares the structures used to record information about current
62 logins and logouts in the file
64 and last logins in the file
66 The time stamps of date changes, shutdowns and reboots are also logged in
71 These files can grow rapidly on busy systems, daily or weekly rotation
73 If any of these files do not exist, it is not created.
75 files must be created manually and are normally maintained in either the script
81 .Bd -literal -offset indent
82 #define _PATH_UTMP "/var/run/utmp"
83 #define _PATH_WTMP "/var/log/wtmp"
84 #define _PATH_LASTLOG "/var/log/lastlog"
88 #define UT_HOSTSIZE 16
92 char ll_line[UT_LINESIZE];
93 char ll_host[UT_HOSTSIZE];
97 char ut_line[UT_LINESIZE];
98 char ut_name[UT_NAMESIZE];
99 char ut_host[UT_HOSTSIZE];
104 Each time a user logs in, the
106 program looks up the user's
110 If it is found, the timestamp of the last time the user logged
111 in, the terminal line and the hostname
112 are written to the standard output. (Providing the login is not
118 program then records the new login time in the file
131 record for the user inserted.
132 This record remains there until
133 the user logs out at which time it is deleted.
136 file is used by the programs
145 program opens the file
147 and appends the user's
152 record, with an updated time stamp is later appended
153 to the file when the user logs out. (See
157 file is used by the programs
162 In the event of a date change, a shutdown or reboot, the
163 following items are logged in the
167 .Bl -tag -width shutdownxx -compact
170 A system reboot or shutdown has been initiated.
173 is placed in the field
187 The system time has been manually or automatically updated.
192 is recorded in the field
198 indicates the time prior to the change, and the character
200 indicates the new time.
204 (These files no longer exist in 10.5 or later.)
207 .Bl -tag -width /var/log/lastlog -compact
214 .It Pa /var/log/lastlog
229 file format appeared in
233 file format appeared in