]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/updwtmp.3
share/mk/: distcheck: Run 'check' after 'build'
[thirdparty/man-pages.git] / man3 / updwtmp.3
1 .\" Copyright 1997 Nicolás Lichtmaier <nick@debian.org>
2 .\" Created Wed Jul 2 23:27:34 ART 1997
3 .\"
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.
9 .\"
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.
14 .\"
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.
19 .\"
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/>.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Added info on availability, aeb, 971207
26 .\" Added -lutil remark, 030718
27 .\" 2008-07-02, mtk, document updwtmpx()
28 .\"
29 .TH UPDWTMP 3 2017-09-15 "GNU" "Linux Programmer's Manual"
30 .SH NAME
31 updwtmp, logwtmp \- append an entry to the wtmp file
32 .SH SYNOPSIS
33 .nf
34 .B #include <utmp.h>
35 .PP
36 .BI "void updwtmp(const char *" wtmp_file ", const struct utmp *" ut );
37 .BI "void logwtmp(const char *" line ", const char *" name \
38 ", const char *" host );
39 .fi
40 .PP
41 For
42 .BR logwtmp (),
43 link with \fI\-lutil\fP.
44 .SH DESCRIPTION
45 .BR updwtmp ()
46 appends the utmp structure
47 .I ut
48 to the wtmp file.
49 .PP
50 .BR logwtmp ()
51 constructs a utmp structure using
52 .IR line ", " name ", " host ,
53 current time and current process ID.
54 Then it calls
55 .BR updwtmp ()
56 to append the structure to the wtmp file.
57 .SH FILES
58 .TP
59 .I /var/log/wtmp
60 database of past user logins
61 .SH ATTRIBUTES
62 For an explanation of the terms used in this section, see
63 .BR attributes (7).
64 .TS
65 allbox;
66 lb lb lbw24
67 l l l.
68 Interface Attribute Value
69 T{
70 .BR updwtmp (),
71 .br
72 .BR logwtmp ()
73 T} Thread safety MT-Unsafe sig:ALRM timer
74 .TE
75 .sp 1
76 .SH CONFORMING TO
77 Not in POSIX.1.
78 Present on Solaris, NetBSD, and perhaps other systems.
79 .SH NOTES
80 For consistency with the other "utmpx" functions (see
81 .BR getutxent (3)),
82 glibc provides (since version 2.1):
83 .PP
84 .in +4n
85 .EX
86 .B #include <utmpx.h>
87 .BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx );
88 .EE
89 .in
90 .PP
91 This function performs the same task as
92 .BR updwtmp (),
93 but differs in that it takes a
94 .I utmpx
95 structure as its last argument.
96 .SH SEE ALSO
97 .BR getutxent (3),
98 .BR wtmp (5)