LL2_IMPORT_LASTLOG(3)
okay bestie, welcome to LL2_IMPORT_LASTLOG(3) β yes, that's the title, and this is the Programmers Manual page for it πβ¨ we're importing an old lastlog file into the lastlog2 database, and honestly? iconic little migration moment π¦
π NAME π
ll2_import_lastlog β imports old lastlog file. that's the whole assignment, periodt π
β¨ SYNOPSIS β¨
#include <lastlog2.h>
int ll2_import_lastlog (struct ll2_context *context, const char
*lastlog_file, char **error);
π DESCRIPTION π
so this function is basically the friend who shows up with a moving box: it imports all the entries from the lastlog_file file (lastlog(8)) into the lastlog2 database defined with context. If context is NULL, it takes the default database, which is defined in LL2_DEFAULT_DATABASE β fallback behavior, no cap π«
here's the example from the page, keeping it cute and exact:
char *error = NULL;
const char *lastlog_path = "/var/log/lastlog";
int ret = ll2_import_lastlog (NULL, lastlog_path, &error);
π«Ά RETURN VALUE π«Ά
Returns 0 on success, -ENOMEM or -1 on other failure. If the return value is -1, error contains an error string. But bestie, listen: error is not guaranteed to contain an error string β it could also be NULL β and error should be freed by the caller. so yes, clean up after yourself π
π AUTHORS π
Thorsten Kukuk <kukuk@suse.de> β thank you for the lore π«Ά
π SEE ALSO π
go read these next, iykyk:
lastlog2(3)ll2_new_context(3)ll2_unref_context(3)ll2_read_all(3)ll2_write_entry(3)ll2_read_entry(3)ll2_update_login_time(3)ll2_rename_user(3)ll2_remove_entry(3)
π REPORTING BUGS π
For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues> β don't be shy, they want the tea π΅
π§ AVAILABILITY π§
The liblastlog2 library is part of the util-linux package since version 2.40. It can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/> πΎβ¨
k bye bestie π
this page is brought to you by util-linux 2.41.6, dated 2026-08-31, and the manual page name is LL2_IMPORT_LASTLOG(3) β slay, stay hydrated, and free your error strings π«Άβ¨
π¦ 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