make_kgid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

make_kgid β€” maps a user-namespace gid pair into a kgid. This is make_kgid(9) from the Kernel API Manual, and we're gonna get into it, bestie 🫢✨

✨ SYNOPSIS ✨

kgid_t make_kgid (struct user_namespace *ns , gid_t gid );

πŸŽ€ ARGUMENTS πŸŽ€

  • ns β€” the user namespace that the gid is in. Like, which namespace's world are we translating from? 🌍
  • gid β€” the group identifier. The gid in question, fr fr πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so make_kgid maps a user-namespace gid pair into a kernel-internal kgid, and then returns that kgid. That's the whole glow-up: user-namespace gid goes in, kernel-internal kgid comes out πŸ’…βœ¨

When there is no mapping defined for the user-namespace gid pair, INVALID_GID is returned. Not a vibe, but it's the documented behavior 😭. Callers are expected to test for and handle INVALID_GID being returned β€” like, please check, bestie, don't just ignore the return value πŸ™ˆ. And INVALID_GID may be tested for using gid_valid. Iconic little validation check, no cap βœ…

🌈 SEE ALSO 🌈


That's the whole page, bestie 🫢 β€” brought to you by the ./kernel source/version, dated October 2026, and yes, it's still make_kgid(9) at the bottom πŸ˜ŒπŸŽ€

πŸ“¦ where this page comes from