make_kprojid(9)
π make_kprojid β Kernel API Manual, bestie edition π
okay so we're deep in the kernel API manual rn and today's main character is make_kprojid, from the make_kprojid(9) page. no cap, this one's short but it's giving "tiny function, big responsibility" energy π
β¨ NAME β¨
make_kprojid β maps a user-namespace projid pair into a kprojid. that's it, that's the whole vibe π¦
β¨ SYNOPSIS β¨
kprojid_t make_kprojid (struct user_namespace *ns , projid_t projid );
literally copy that exactly, don't be cute with the spacing, the kernel does not find it funny π
β¨ ARGUMENTS β¨
nsβ the user namespace that the projid is chillin' in πprojidβ the project identifier itself, the little guy we're mapping π
β¨ DESCRIPTION β¨
so what it does: it maps a user-namespace uid pair into a kernel internal kuid, and returns that kuid. yes, that is genuinely what the page says, word for word β we are not editorialising, we are simply reporting the tea ββ¨
and here's the part you actually need to remember, bestie π: when there is no mapping defined for the user-namespace projid pair, INVALID_PROJID is returned.
β οΈ callers are expected to test for and handle INVALID_PROJID being returned. like, this is not optional, this is not a "later" task, this is a "do it or your code is a mess" task π
also very slay of the kernel: INVALID_PROJID may be tested for using projid_valid. use the helper, it's there for you, it loves you π«Ά
β¨ SEE ALSO β¨
- kernel file
./kernel/user_namespace.cβ the source, the origin story, the lore π make_kuid(9)from_kuid(9)from_kuid_munged(9)make_kgid(9)from_kgid(9)from_kgid_munged(9)from_kprojid(9)from_kprojid_munged(9)verify_root_map(9)
and that's the page!! from the ./kernel source, dated October 2026, under the name make_kprojid(9) β go forth, validate your projids, and slay π
πΈπ¦
π¦ 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