]> git.ipfire.org Git - thirdparty/util-linux.git/blob - liblastlog2/man/ll2_update_login_time.3.adoc
lastlog2 - Y2038 safe version of lastlog
[thirdparty/util-linux.git] / liblastlog2 / man / ll2_update_login_time.3.adoc
1 //po4a: entry man manual
2 = ll2_update_login_time(3)
3 :doctype: manpage
4 :man manual: Programmer's Manual
5 :man source: util-linux {release-version}
6 :page-layout: base
7 :lib: liblastlog2
8 :firstversion: 2.40
9
10 == NAME
11
12 ll2_update_login_time - Writes an *new* entry with updated login time.
13
14 == SYNOPSIS
15
16 *#include <lastlog2.h>*
17
18 *int ll2_update_login_time (struct ll2_context *__context__,
19 const char *__user__, int64_t __ll_time__,
20 char **__error__);*
21
22 == DESCRIPTION
23
24 Writes an *new* entry to database, defined in _context_, for user _user_.
25 Time is set by _ll_time_ whereas the other values are taken from
26 an already existing entry.
27 If _context_ is NULL, the default database, defined in _LL2_DEFAULT_DATABASE_,
28 will be taken.
29
30 --------------------------------------
31 char *error = NULL;
32 const char *user = "root";
33 int64_t login_time = time(0); // Get the system time;
34
35 int ret = ll2_update_login_time (NULL, user, login_time, &error);
36 --------------------------------------
37
38 == RETURN VALUE
39
40 Returns 0 on success, -ENOMEM or -1 on other failure.
41 _error_ contains an error string if the return value is -1.
42 _error_ is not guaranteed to contain an error string. It could also be NULL if the return value is -1.
43 _error_ should be freed by the caller.
44
45 == AUTHORS
46
47 Thorsten Kukuk (kukuk@suse.de)
48
49 == SEE ALSO
50
51 *lastlog2*(3),
52 *ll2_new_context(3),
53 *ll2_unref_context(3),
54 *ll2_read_all*(3),
55 *ll2_write_entry*(3),
56 *ll2_read_entry*(3),
57 *ll2_remove_entry*(3),
58 *ll2_rename_user*(3),
59 *ll2_import_lastlog*(3)
60
61 include::man-common/bugreports.adoc[]
62
63 include::man-common/footer-lib.adoc[]
64
65 ifdef::translation[]
66 include::man-common/translation.adoc[]
67 endif::[]