LL2_REMOVE_ENTRY(3)
π
LL2_REMOVE_ENTRY(3) β the ll2_remove_entry page, but make it make sense
okay so bestie, listen. this is a page from the Programmers Manual section 3, and it's about ll2_remove_entry β the little function that yeets a user out of the lastlog2 database entirely. it's giving cleanup era, and honestly? iconic. π§Ήβ¨
πΈ NAME πΈ
ll2_remove_entry β Removes all entries of a user.
like, all of them. not one, not two. every single entry that belongs to that user? gone. poof. π«Ά
β¨ SYNOPSIS β¨
#include <lastlog2.h>
int ll2_remove_entry (struct ll2_context *context, const char *user,
char **error);
so you pull in lastlog2.h, and then you call ll2_remove_entry with a context, a user, and a place to stash your error. simple. clean. slay.
π DESCRIPTION π
Removes all database entries, defined in context, with the user name user. If context is NULL, the default database, defined in LL2_DEFAULT_DATABASE, will be taken.
so basically: you hand it a context and a username, and it nukes every row that matches that user. and if you're feeling lazy and pass NULL as the context? no worries, it just defaults to whatever database LL2_DEFAULT_DATABASE points at. main character energy from the default, honestly. π
and here's the little demo they give you, bestie β look how easy:
char *error = NULL;
const char *user = "root";
int ret = ll2_remove_entry (NULL, user, &error);
NULL context (so, default database), user is "root", and &error so you can grab the tea if something goes wrong. note the cute alignment on char *error and const char *user β that's just how they write it, we keep it exactly like that. π
π₯ RETURN VALUE π₯
Returns 0 on success, -ENOMEM or -1 on other failure.
so, vibe check on the return value:
0β we ate. success. π-ENOMEMβ out of memory, tragic.-1β some other failure, unspecified, mysterious, not the move. π
and about that error:
errorcontains an error string if the return value is-1.erroris not guaranteed to contain an error string, could also beNULL.errorshould be freed by the caller.
bestie, read that again. even when you get -1, the error might legitimately be NULL. so check it before you dereference it, okay?? and when it is a string? you free it. the caller frees it. that's you. don't forget, or that's a leak and we don't do leaks here. π
π¦ AUTHORS π¦
Thorsten Kukuk <kukuk@suse.de>
the icon who wrote this. we stan. π«Ά
π SEE ALSO π
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_import_lastlog(3)
the whole friend group, fr fr. go read them next. iykyk. π
π REPORTING BUGS π
For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.
found a bug? don't suffer in silence, bestie β drop it in the issue tracker at <https://github.com/util-linux/util-linux/issues>. that's the whole link, character for character, because i am not about to paraphrase a URL. π
β 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/>.
so if you're on util-linux 2.40 or later, liblastlog2 is already in the building. π earlier than that? sorry babe, it doesn't exist yet. and if you want to grab it directly, it lives at <https://www.kernel.org/pub/linux/utils/util-linux/>, which is also typed out exactly and not vibed-at. π
πΈ ok that's the whole page, no notes, go delete some entries responsibly πΈ
sign-off tea: this rendering comes from util-linux 2.41.6, dated 2026-08-31, and the page itself is LL2_REMOVE_ENTRY(3) β mwah, periodt. ππ
π¦ 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