from_kuid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 a uid in. 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: if kuid has no mapping in targ, then (uid_t)-1 is 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 πŸ‘‹


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