LL2_UPDATE_LOGIN_TIME(3)
π LL2_UPDATE_LOGIN_TIME(3) π
ok so bestie, we're in the lastlog2.h cinematic universe β this is the ll2_update_login_time page from the lastlog2 section 3 manual, and yes it's giving "tiny function, very important job" energy. let's get into it π«Ά
β¨ NAME β¨
ll2_update_login_time β writes a new entry with updated login time. yep that's the whole vibe, she updates and she writes π₯
β¨ SYNOPSIS β¨
#include <lastlog2.h>
int ll2_update_login_time (struct ll2_context *context, const char
*user, int64_t ll_time, char **error);
β¨ DESCRIPTION β¨
okay so what does she actually do? ll2_update_login_time writes a new entry to the database (the one defined in context), and that entry is for user. the time gets set by ll_time, and literally every other value is copied over from an entry that already exists. so she's not inventing a whole new person, she's just refreshing the timestamp on someone who's already in there. lowkey iconic π
and if context is NULL? no stress β the default database, defined in LL2_DEFAULT_DATABASE, gets taken instead. main character fallback behaviour fr fr β¨
char *error = NULL;
const char *user = "root";
int64_t login_time = time(0); // Get the system time;
int ret = ll2_update_login_time (NULL, user, login_time, &error);
that's the whole call, bestie: "root", the current system time, NULL context so the default db gets used, and a lil error pointer ready to catch anything π
β¨ RETURN VALUE β¨
ok so the tea on what she hands back:
- returns
0on success π - returns
-ENOMEMor-1on other failure π errorcontains an error string if the return value is-1- but
erroris not guaranteed to contain an error string β it could also beNULL. do not come for her about it, that's just how it is π errorshould be freed by the caller. yes you, bestie β that's your job, don't forget, memory leaks are not the vibe π
β¨ AUTHORS β¨
Thorsten Kukuk <kukuk@suse.de> β thank him pls, he wrote this πΈ
β¨ SEE ALSO β¨
the whole lastlog2 friend group, go say hi:
lastlog2(3)ll2_new_context(3)ll2_unref_context(3)ll2_read_all(3)ll2_write_entry(3)ll2_read_entry(3)ll2_remove_entry(3)ll2_rename_user(3)ll2_import_lastlog(3)
β¨ REPORTING BUGS β¨
found a bug? don't suffer in silence, bestie π for bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues> β they'll sort you out π«Ά
β¨ AVAILABILITY β¨
the liblastlog2 library is part of the util-linux package since version 2.40. it can be downloaded from the Linux Kernel Archive at <https://www.kernel.org/pub/linux/utils/util-linux/> π¦
and that's the page, babes π this was util-linux 2.41.6, dated 2026-08-31, and she's LL2_UPDATE_LOGIN_TIME(3) β slay, go update those login times, ily, mwah πβ¨
π¦ where this page comes from
- alpine 3.22: util-linux-doc 2.41.6-r1 Β· GPL-3.0-or-later AND GPL-2.0-or-later AND GPL-2.0-only AND GPL-1.0-only AND LGPL-2.1-or-later AND BSD-1-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND MIT AND Public-Domain
- alpine 3.23: util-linux-doc 2.41.6-r1 Β· GPL-3.0-or-later AND GPL-2.0-or-later AND GPL-2.0-only AND GPL-1.0-only AND LGPL-2.1-or-later AND BSD-1-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND MIT AND Public-Domain
- fedora 43: liblastlog2-devel 2.41.6-1.fc43 Β· BSD-2-Clause
- fedora 43: liblastlog2-devel 2.41.6-1.fc43 Β· BSD-2-Clause
- fedora 44: liblastlog2-devel 2.41.6-1.fc44 Β· BSD-2-Clause
- fedora 44: liblastlog2-devel 2.41.6-1.fc44 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms