AUDIT_GETLOGINUID(3)
π AUDIT_GETLOGINUID π
okay bestie, welcome to the Linux Audit API corner of the man pages πΈ this one's short and sweet, it's literally just one function and she's an icon, no cap.
β¨ NAME β¨
audit_getloginuid β get a program's loginuid value π
π SYNOPSIS π
#include <libaudit.h>
uid_t audit_getloginuid(void);
like yes, that's the whole vibe. include the header, call the function, no arguments, we love a zero-arg queen π
π¦ DESCRIPTION π¦
so this function returns the task attribute loginuid. that's it. that's the whole job. she shows up, she hands you the loginuid, she leaves π«Ά
π RETURN VALUE π
if the loginuid was set, you get that value back. slay β¨
but if loginuid was unset, it returns a -1. and here's the little plot twist that gets everybody: uid_t is an unsigned type, so you're not gonna see a -1 staring back at you β you'll see the converted value instead π it's giving "the math said no". don't let it catch you off guard, fr fr.
π₯ ERRORS π₯
on failure, this function returns -1. but listen β in the event of a real error, errno would be set. so if you're out here just checking the return value and not errno, that's not the move bestie π
the function can set errno based on failures of open, read, or strtoul. that's the whole list, no more no less π
ngl the-1vs unsigneduid_tsituation from RETURN VALUE applies here too, so keep both eyes open when you're doing your vibe check on the result.
π SEE ALSO π
audit_setloginuid(3)β the other half of the duo, go read her too π
π AUTHOR π
Steve Grubb β¨ absolute legend, we stan.
mwah π that's the page, bestie. this one came from Red Hat, dated Oct 2006 β vintage but still iconic, like a limited edition π go forth and get those loginuids, iykyk π¦β
π¦ where this page comes from
- alpine 3.23: audit-doc 4.1.2-r2 Β· LGPL-2.1-or-later
- alpine 3.24: audit-doc 4.1.2-r6 Β· LGPL-2.1-or-later
- arch rolling: audit 4.2.1-1 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- centos-stream 10: audit-libs-devel 4.2.1-3.el10 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.1.1-2.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.1.1-2.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.1.4-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.1.4-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- nixpkgs unstable: audit 4.2.1
- ubuntu resolute: libaudit-dev 1:4.1.2-1build1 Β· GPL-2.0-only
- ubuntu resolute: libaudit-dev 1:4.1.2-1ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libaudit-dev 1:4.1.2-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms