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

DESCRIPTION

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

FILES

22       /var/log/wtmp
23              database of past user logins
24

CONFORMING TO

26       Not  in  POSIX.1-2001.   Present  on Solaris, NetBSD, and perhaps other
27       systems.
28

AVAILABILITY

30       Both functions are available under glibc2, but not under  libc5.   How‐
31       ever,  logwtmp()  used  to  occur  in  the old libbsd.  These days, the
32       logwtmp() function is included in libutil.  (Hence you'll need  to  add
33       -lutil to your compiler command line to get it.)
34

NOTES

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

SEE ALSO

47       getutxent(3), wtmp(5)
48

COLOPHON

50       This  page  is  part of release 3.22 of the Linux man-pages project.  A
51       description of the project, and information about reporting  bugs,  can
52       be found at http://www.kernel.org/doc/man-pages/.
53
54
55
56GNU                               2008-07-02                        UPDWTMP(3)
Impressum