OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / 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  2014-08-19 "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 .sp
36 .BI "void updwtmp(const char *" wtmp_file ", const struct utmp *" ut );
37 .br
38 .BI "void logwtmp(const char *" line ", const char *" name \
39 ", const char *" host );
40 .fi
41
42 For
43 .BR logwtmp (),
44 link with \fI\-lutil\fP.
45 .SH DESCRIPTION
46 .BR updwtmp ()
47 appends the utmp structure
48 .I ut
49 to the wtmp file.
50 .PP
51 .BR logwtmp ()
52 constructs a utmp structure using
53 .IR line ", " name ", " host ,
54 current time and current process ID.
55 Then it calls
56 .BR updwtmp ()
57 to append the structure to the wtmp file.
58 .SH FILES
59 .TP
60 .I /var/log/wtmp
61 database of past user logins
62 .SH CONFORMING TO
63 Not in POSIX.1-2001.
64 Present on Solaris, NetBSD, and perhaps other systems.
65 .SH NOTES
66 For consistency with the other "utmpx" functions (see
67 .BR getutxent (3)),
68 glibc provides (since version 2.1):
69 .nf
70 .sp
71 .B #include <utmpx.h>
72 .sp
73 .BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx );
74 .fi
75 .PP
76 This function performs the same task as
77 .BR updwtmp (),
78 but differs in that it takes a
79 .I utmpx
80 structure as its last argument.
81 .SH SEE ALSO
82 .BR getutxent (3),
83 .BR wtmp (5)
84 .SH COLOPHON
85 This page is part of release 3.79 of the Linux
86 .I man-pages
87 project.
88 A description of the project,
89 information about reporting bugs,
90 and the latest version of this page,
91 can be found at
92 \%http://www.kernel.org/doc/man\-pages/.