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,
0is returned. slay. โ - on error,
-1is returned, anderrnois 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
- Copyright 2017, Michael Kerrisk <mtk.manpages@gmail.com>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms