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:

πŸ› 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