1 .\" Derived from text written by Martin Schulze (or taken from glibc.info)
2 .\" and text written by Paul Thompson - both copyright 2002.
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
25 .TH LOGIN 3 2004-05-06 "GNU" "Linux Programmer's Manual"
27 login, logout \- write utmp and wtmp entries
31 .BI "void login(const struct utmp *" ut );
33 .BI "int logout(const char *" ut_line );
35 Link with \fI\-lutil\fP.
37 The utmp file records who is currently using the system.
38 The wtmp file records all logins and logouts.
47 and writes it to both the utmp and the wtmp file.
51 clears the entry in the utmp file again.
57 struct, fills the field
59 (if there is such a field) with the value
63 (if there is such a field) with the process ID of the calling process.
64 Then it tries to fill the field
70 that is a terminal, and
71 stores the corresponding pathname minus a possible leading
73 into this field, and then writes the struct to the utmp file.
75 if no terminal name was found, this field is filled with "???"
76 and the struct is not written to the utmp file.
77 After this, the struct is written to the wtmp file.
81 function searches the utmp file for an entry matching the
84 If a record is found, it is updated by zeroing out the
90 timestamp field and setting
92 (if there is such a field) to
97 function returns 1 if the entry was successfully written to the
98 database, or 0 if an error occurred.
102 user accounting database, configured through
108 user accounting log file, configured through
126 is defined as an alias for