NS_GET_OWNER_UID(2const)

๐Ÿ‘‘ NS_GET_OWNER_UID ๐Ÿ’…

okay bestie, pull up a chair, because today we're reading the manual page for NS_GET_OWNER_UID, from the <rainbow>NS_GET_OWNER_UID(2const)</rainbow> corner of the Linux manual. it's giving detective energy, it's giving "who made this namespace", it's giving everything. ๐Ÿ•ต๏ธโ™€๏ธโœจ


โœจ NAME โœจ

NS_GET_OWNER_UID โ€” the glow-up tool for discovering the owner of a user namespace ๐Ÿ’–


๐Ÿ”ฎ SYNOPSIS ๐Ÿ”ฎ

#include <linux/nsfs.h>  /* Definition of NS_GET_OWNER_UID */
#include <sys/ioctl.h>

int ioctl(int fd, NS_GET_OWNER_UID, uid_t *uid);

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so, the NS_GET_OWNER_UID operation is literally your backstage pass ๐ŸŽŸ๏ธ โ€” you use it to discover the owner user ID of a user namespace. and what does "owner user ID" mean exactly?? it's the effective user ID of the process that created the user namespace. like, the founding mother of the whole thing. the main character who started it all. ๐Ÿ‘‘

fd refers to a /proc/pid/ns/user file. that's the file you're pointing at, bestie. ๐Ÿซถ

the owner user ID gets returned in the uid_t pointed to by the third argument. so you hand it a pointer, it fills that pointer with the truth. no cap. ๐Ÿ’…


๐ŸŽ€ RETURN VALUE ๐ŸŽ€

  • on success, 0 is returned. slay. โœ…
  • on error, -1 is returned, and errno is set to indicate the error. ๐Ÿ˜ญ

๐Ÿ’€ ERRORS ๐Ÿ’€

  • EINVAL โ€” fd does not refer to a user namespace. like, wrong file, wrong vibe, wrong everything. this is not the namespace you're looking for. ๐Ÿ™ˆ

๐ŸŒˆ STANDARDS ๐ŸŒˆ

Linux. that's it. that's the whole standard. periodt. ๐Ÿ’…


โญ HISTORY โญ

Linux 4.11. she's been iconic since 4.11, we love a legacy queen. ๐Ÿ‘‘


๐ŸŒธ SEE ALSO ๐ŸŒธ


and that's the whole page, bestie!! this lil gem is from the Linux man-pages 6.20 era, dated 2026-02-08, and fr fr it's been a pleasure reading it with you. go forth, find out who owns your namespaces, and stay iconic. ๐Ÿฆ‹๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: Linux-man-pages-copyleft
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms