1UPDWTMP(3)                 Linux Programmer's Manual                UPDWTMP(3)
2
3
4

NAME

6       updwtmp, logwtmp - append an entry to the wtmp file
7

SYNOPSIS

9       #include <utmp.h>
10
11       void updwtmp(const char *wtmp_file, const struct utmp *ut);
12       void logwtmp(const char *line, const char *name, const char *host);
13
14       For logwtmp(), link with -lutil.
15

DESCRIPTION

17       updwtmp() appends the utmp structure ut to the wtmp file.
18
19       logwtmp()  constructs  a utmp structure using line, name, host, current
20       time, and current process ID.  Then it calls updwtmp()  to  append  the
21       structure to the wtmp file.
22

FILES

24       /var/log/wtmp
25              database of past user logins
26

ATTRIBUTES

28       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
29       tributes(7).
30
31       ┌───────────────────────────┬───────────────┬──────────────────────────┐
32Interface                  Attribute     Value                    
33       ├───────────────────────────┼───────────────┼──────────────────────────┤
34updwtmp(), logwtmp()       │ Thread safety │ MT-Unsafe sig:ALRM timer │
35       └───────────────────────────┴───────────────┴──────────────────────────┘
36

CONFORMING TO

38       Not in POSIX.1.  Present on Solaris, NetBSD, and perhaps other systems.
39

NOTES

41       For consistency with the other "utmpx"  functions  (see  getutxent(3)),
42       glibc provides (since version 2.1):
43
44           #include <utmpx.h>
45           void updwtmpx (const char *wtmpx_file, const struct utmpx *utx);
46
47       This  function performs the same task as updwtmp(), but differs in that
48       it takes a utmpx structure as its last argument.
49

SEE ALSO

51       getutxent(3), wtmp(5)
52

COLOPHON

54       This page is part of release 5.13 of the Linux  man-pages  project.   A
55       description  of  the project, information about reporting bugs, and the
56       latest    version    of    this    page,    can     be     found     at
57       https://www.kernel.org/doc/man-pages/.
58
59
60
61GNU                               2021-03-22                        UPDWTMP(3)
Impressum