UIDINFO(9)
π UIDINFO(9) π
ok so bestie, welcome to the uidinfo page from the Kernel Developer's Manual β yes we're in section 9, we're in the kernel, we're doing UID bookkeeping and honestly? it's giving main character energy. π
β¨ NAME β¨
uidinfo, uihashinit, uifind, uihold, uifree β the whole girl gang of functions for managing UID information π«Ά
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/resourcevar.h>
void
uihashinit(void);
struct uidinfo *
uifind(uid_t uid);
void
uihold(struct uidinfo *uip);
void
uifree(struct uidinfo *uip);
like, copy that exactly bestie, no typos, the compiler is not forgiving π
β¨ DESCRIPTION β¨
The uidinfo family of functions manages uidinfo structures. Every single uidinfo structure keeps track of per-uid resource consumption counts β and we mean per uid, like one lil record per user β including the process count and the socket buffer space usage. no cap. πΈ
π uihashinit()
uihashinit() initializes the uidinfo hash table and its mutex. π§
β οΈ bestie, listen: this one should only be called during system initialization. it's not a "call it whenever" situation, it's a "call it once, at boot, and then never speak of it again" situation. periodt.
π uifind()
uifind() looks up and returns the uidinfo structure for uid. π
And if there's no uidinfo structure chillin' there for uid yet? don't even worry, a brand new structure will be allocated and initialized for you. iconic behavior honestly.
oh and heads up β the uidinfo hash mutex is acquired and released. yes ma'am, we lock and unlock, that's just how we move here. π₯
π uihold()
uihold() increases the reference count on uip. β¨
uip's lock is acquired and released. that's the whole thing. simple. clean. slay.
π uifree()
uifree() decreases the reference count on uip, and if that count reaches 0, uip is freed. π (rip lil struct, you did amazing sweetie)
uip's lock is acquired and released, and the uidinfo hash mutex may be acquired and released too. yes, "may" β we're being precise, don't @ me. π¦
β¨ RETURN VALUES β¨
uifind() returns a pointer to an initialized uidinfo structure β and it should not fail. like, it's not going to ghost you. it's reliable. π
β¨ AUTHORS β¨
This manual page was written by Chad David <davidc@acns.ab.ca>. π«Ά
and that's the whole page bestie, mwah π
this lil beauty is from the Debian crew and it's dated July 10, 2001 β yeah, it's an elder but it's still serving, we love her, bye bye πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms