Debian Codegraph @

liblastlog2/man/ll2_import_lastlog.3

raw
1 '\" t
2 .\" Title: ll2_import_lastlog
3 .\" Author: [see the "AUTHOR(S)" section]
4 .\" Generator: Asciidoctor 2.0.20
5 .\" Date: 2026-04-28
6 .\" Manual: Programmer's Manual
7 .\" Source: util-linux 2.42.1
8 .\" Language: English
9 .\"
10 .TH "LL2_IMPORT_LASTLOG" "3" "2026-04-28" "util\-linux 2.42.1" "Programmer\*(Aqs Manual"
11 .ie \n(.g .ds Aq \(aq
12 .el .ds Aq '
13 .ss \n[.ss] 0
14 .nh
15 .ad l
16 .de URL
17 \fI\\$2\fP <\\$1>\\$3
18 ..
19 .als MTO URL
20 .if \n[.g] \{\
21 . mso www.tmac
22 . am URL
23 . ad l
24 . .
25 . am MTO
26 . ad l
27 . .
28 . LINKSTYLE blue R < >
29 .\}
30 .SH "NAME"
31 ll2_import_lastlog \- Imports old lastlog file.
32 .SH "SYNOPSIS"
33 .sp
34 \fB#include <lastlog2.h>\fP
35 .sp
36 \fBint ll2_import_lastlog (struct ll2_context *\fIcontext\fP,
37 const char *\fIlastlog_file\fP,
38 char **\fIerror\fP);\fP
39 .SH "DESCRIPTION"
40 .sp
41 Imports all entries from \fIlastlog_file\fP file (\fBlastlog\fP(8)) into
42 lastlog2 database defined with \fIcontext\fP.
43 If \fIcontext\fP is NULL, the default database, defined in \fILL2_DEFAULT_DATABASE\fP,
44 will be taken.
45 .sp
46 .if n .RS 4
47 .nf
48 .fam C
49 char *error = NULL;
50 const char *lastlog_path = "/var/log/lastlog";
51
52 int ret = ll2_import_lastlog (NULL, lastlog_path, &error);
53 .fam
54 .fi
55 .if n .RE
56 .SH "RETURN VALUE"
57 .sp
58 Returns 0 on success, \-ENOMEM or \-1 on other failure.
59 \fIerror\fP contains an error string if the return value is \-1.
60 \fIerror\fP is not guaranteed to contain an error string, could also be NULL.
61 \fIerror\fP should be freed by the caller.
62 .SH "AUTHORS"
63 .sp
64 .MTO "kukuk\(atsuse.de" "Thorsten Kukuk" ""
65 .SH "SEE ALSO"
66 .sp
67 \fBlastlog2\fP(3),
68 \fBll2_new_context\fP(3),
69 \fBll2_unref_context\fP(3),
70 \fBll2_read_all\fP(3),
71 \fBll2_write_entry\fP(3),
72 \fBll2_read_entry\fP(3),
73 \fBll2_update_login_time\fP(3),
74 \fBll2_rename_user\fP(3),
75 \fBll2_remove_entry\fP(3)
76 .SH "REPORTING BUGS"
77 .sp
78 For bug reports, use the \c
79 .URL "https://github.com/util\-linux/util\-linux/issues" "issue tracker" "."
80 .SH "AVAILABILITY"
81 .sp
82 The \fBliblastlog2\fP library is part of the util\-linux package since version 2.40. It can be downloaded from \c
83 .URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."