Debian Codegraph @

upstream/debian-trixie/man3/updwtmp.3

raw
1 '\" t
2 .\" Copyright 1997 Nicolás Lichtmaier <[email protected]>
3 .\" Created Wed Jul 2 23:27:34 ART 1997
4 .\"
5 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\"
7 .\" Added info on availability, aeb, 971207
8 .\" Added -lutil remark, 030718
9 .\" 2008-07-02, mtk, document updwtmpx()
10 .\"
11 .TH updwtmp 3 2024-05-02 "Linux man-pages 6.9.1"
12 .SH NAME
13 updwtmp, logwtmp \- append an entry to the wtmp file
14 .SH LIBRARY
15 System utilities library
16 .RI ( libutil ", " \-lutil )
17 .SH SYNOPSIS
18 .nf
19 .B #include <utmp.h>
20 .P
21 .BI "void updwtmp(const char *" wtmp_file ", const struct utmp *" ut );
22 .BI "void logwtmp(const char *" line ", const char *" name \
23 ", const char *" host );
24 .fi
25 .SH DESCRIPTION
26 .BR updwtmp ()
27 appends the utmp structure
28 .I ut
29 to the wtmp file.
30 .P
31 .BR logwtmp ()
32 constructs a utmp structure using
33 .IR line ", " name ", " host ,
34 current time, and current process ID.
35 Then it calls
36 .BR updwtmp ()
37 to append the structure to the wtmp file.
38 .SH FILES
39 .TP
40 .I /var/log/wtmp
41 database of past user logins
42 .SH ATTRIBUTES
43 For an explanation of the terms used in this section, see
44 .BR attributes (7).
45 .TS
46 allbox;
47 lbx lb lb
48 l l l.
49 Interface Attribute Value
50 T{
51 .na
52 .nh
53 .BR updwtmp (),
54 .BR logwtmp ()
55 T} Thread safety MT-Unsafe sig:ALRM timer
56 .TE
57 .SH VERSIONS
58 For consistency with the other "utmpx" functions (see
59 .BR getutxent (3)),
60 glibc provides (since glibc 2.1):
61 .P
62 .in +4n
63 .EX
64 .BR "#define _GNU_SOURCE " "/* See feature_test_macros(7) */"
65 .B #include <utmpx.h>
66 .BI "void updwtmpx (const char *" wtmpx_file ", const struct utmpx *" utx );
67 .EE
68 .in
69 .P
70 This function performs the same task as
71 .BR updwtmp (),
72 but differs in that it takes a
73 .I utmpx
74 structure as its last argument.
75 .SH STANDARDS
76 None.
77 .SH HISTORY
78 Solaris, NetBSD.
79 .SH SEE ALSO
80 .BR getutxent (3),
81 .BR wtmp (5)