Blame man3/updwtmp.3

Packit 7cfc04
.\" Copyright 1997 Nicolás Lichtmaier <nick@debian.org>
Packit 7cfc04
.\" Created Wed Jul  2 23:27:34 ART 1997
Packit 7cfc04
.\"
Packit 7cfc04
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
Packit 7cfc04
.\" This is free documentation; you can redistribute it and/or
Packit 7cfc04
.\" modify it under the terms of the GNU General Public License as
Packit 7cfc04
.\" published by the Free Software Foundation; either version 2 of
Packit 7cfc04
.\" the License, or (at your option) any later version.
Packit 7cfc04
.\"
Packit 7cfc04
.\" The GNU General Public License's references to "object code"
Packit 7cfc04
.\" and "executables" are to be interpreted as the output of any
Packit 7cfc04
.\" document formatting or typesetting system, including
Packit 7cfc04
.\" intermediate and printed output.
Packit 7cfc04
.\"
Packit 7cfc04
.\" This manual is distributed in the hope that it will be useful,
Packit 7cfc04
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 7cfc04
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 7cfc04
.\" GNU General Public License for more details.
Packit 7cfc04
.\"
Packit 7cfc04
.\" You should have received a copy of the GNU General Public
Packit 7cfc04
.\" License along with this manual; if not, see
Packit 7cfc04
.\" <http://www.gnu.org/licenses/>.
Packit 7cfc04
.\" %%%LICENSE_END
Packit 7cfc04
.\"
Packit 7cfc04
.\" Added info on availability, aeb, 971207
Packit 7cfc04
.\" Added -lutil remark, 030718
Packit 7cfc04
.\" 2008-07-02, mtk, document updwtmpx()
Packit 7cfc04
.\"
Packit 7cfc04
.TH UPDWTMP 3  2017-09-15 "GNU" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
updwtmp, logwtmp \- append an entry to the wtmp file
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
.nf
Packit 7cfc04
.B #include <utmp.h>
Packit 7cfc04
.PP
Packit 7cfc04
.BI "void updwtmp(const char *" wtmp_file ", const struct utmp *" ut );
Packit 7cfc04
.BI "void logwtmp(const char *" line ", const char *" name \
Packit 7cfc04
", const char *" host );
Packit 7cfc04
.fi
Packit 7cfc04
.PP
Packit 7cfc04
For
Packit 7cfc04
.BR logwtmp (),
Packit 7cfc04
link with \fI\-lutil\fP.
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
.BR updwtmp ()
Packit 7cfc04
appends the utmp structure
Packit 7cfc04
.I ut
Packit 7cfc04
to the wtmp file.
Packit 7cfc04
.PP
Packit 7cfc04
.BR logwtmp ()
Packit 7cfc04
constructs a utmp structure using
Packit 7cfc04
.IR line ", " name ", " host ,
Packit 7cfc04
current time and current process ID.
Packit 7cfc04
Then it calls
Packit 7cfc04
.BR updwtmp ()
Packit 7cfc04
to append the structure to the wtmp file.
Packit 7cfc04
.SH FILES
Packit 7cfc04
.TP
Packit 7cfc04
.I /var/log/wtmp
Packit 7cfc04
database of past user logins
Packit 7cfc04
.SH ATTRIBUTES
Packit 7cfc04
For an explanation of the terms used in this section, see
Packit 7cfc04
.BR attributes (7).
Packit 7cfc04
.TS
Packit 7cfc04
allbox;
Packit 7cfc04
lb lb lbw24
Packit 7cfc04
l l l.
Packit 7cfc04
Interface	Attribute	Value
Packit 7cfc04
T{
Packit 7cfc04
.BR updwtmp (),
Packit 7cfc04
.br
Packit 7cfc04
.BR logwtmp ()
Packit 7cfc04
T}	Thread safety	MT-Unsafe sig:ALRM timer
Packit 7cfc04
.TE
Packit 7cfc04
.sp 1
Packit 7cfc04
.SH CONFORMING TO
Packit 7cfc04
Not in POSIX.1.
Packit 7cfc04
Present on Solaris, NetBSD, and perhaps other systems.
Packit 7cfc04
.SH NOTES
Packit 7cfc04
For consistency with the other "utmpx" functions (see
Packit 7cfc04
.BR getutxent (3)),
Packit 7cfc04
glibc provides (since version 2.1):
Packit 7cfc04
.PP
Packit 7cfc04
.in +4n
Packit 7cfc04
.EX
Packit 7cfc04
.B #include <utmpx.h>
Packit 7cfc04
.BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx );
Packit 7cfc04
.EE
Packit 7cfc04
.in
Packit 7cfc04
.PP
Packit 7cfc04
This function performs the same task as
Packit 7cfc04
.BR updwtmp (),
Packit 7cfc04
but differs in that it takes a
Packit 7cfc04
.I utmpx
Packit 7cfc04
structure as its last argument.
Packit 7cfc04
.SH SEE ALSO
Packit 7cfc04
.BR getutxent (3),
Packit 7cfc04
.BR wtmp (5)
Packit 7cfc04
.SH COLOPHON
Packit 7cfc04
This page is part of release 4.15 of the Linux
Packit 7cfc04
.I man-pages
Packit 7cfc04
project.
Packit 7cfc04
A description of the project,
Packit 7cfc04
information about reporting bugs,
Packit 7cfc04
and the latest version of this page,
Packit 7cfc04
can be found at
Packit 7cfc04
\%https://www.kernel.org/doc/man\-pages/.