1updwtmp(3)                 Library Functions Manual                 updwtmp(3)
2
3
4

NAME

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

LIBRARY

9       System utilities library (libutil, -lutil)
10

SYNOPSIS

12       #include <utmp.h>
13
14       void updwtmp(const char *wtmp_file, const struct utmp *ut);
15       void logwtmp(const char *line, const char *name, const char *host);
16

DESCRIPTION

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

FILES

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

ATTRIBUTES

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

VERSIONS

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

STANDARDS

50       None.
51

HISTORY

53       Solaris, NetBSD.
54

SEE ALSO

56       getutxent(3), wtmp(5)
57
58
59
60Linux man-pages 6.04              2023-03-30                        updwtmp(3)
Impressum