make_kprojid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 ✨


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