from_kuid(9)
π from_kuid(9)
okay so bestie, welcome to the Kernel API Manual β this one's a lil function called from_kuid, and honestly it's giving "quietly essential" energy. Let's get into it π«Ά
πΈ NAME
from_kuid β create a uid from a kuid user-namespace pair.
Like, it literally builds you a uid out of a namespace-pair situation. iconic behavior tbh β¨
π SYNOPSIS
uid_t from_kuid (struct user_namespace *targ , kuid_t kuid );
Look at that signature. so clean. so deliberate. we love a well-typed moment π
π¦ ARGUMENTS
targβ the user namespace we want auidin. like, where do you want your uid to live? this is that. the destination vibe πΊοΈkuidβ the kernel internal uid to start with. this is the raw ingredient, the starting point, the "before" pic if you will π
β DESCRIPTION
so the whole thing here is: map kuid into the user-namespace specified by targ, and return the resulting uid. that's the assignment. that's the whole job. and it ate π
lowkey important detail: there is always a mapping into the initial user_namespace. no cap. that one's guaranteed, it's the safe home base π
β οΈ and here's the part where you pay attention bestie: ifkuidhas no mapping intarg, then(uid_t)-1is returned. that's your "nope, not found" signal. not a crash, not a vibe, just(uid_t)-1. periodt π
π SEE ALSO
Kernel file ./kernel/user_namespace.c, plus the whole friend group of related calls β go say hi π
make_kuid(9)from_kuid_munged(9)make_kgid(9)from_kgid(9)from_kgid_munged(9)make_kprojid(9)from_kprojid(9)from_kprojid_munged(9)verify_root_map(9)
k that's the whole page, bestie β you're officially a namespace girlie now π§ββοΈπ
signing off from ./kernel, dated October 2026, page from_kuid(9) β mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms