NS_GET_NSTYPE(2const)

πŸ’… NS_GET_NSTYPE πŸ’…

okay bestie, so this is a <pink>Linux</pink> thing β€” a <purple>2const</purple> man page, which is just the fancy way of saying "this is one specific operation you can pass to ioctl(2), we gave it its own page because it's iconic like that." ✨


🌸 NAME 🌸

NS_GET_NSTYPE β€” it's giving discovering the namespace type, no cap πŸ•΅οΈβ™€οΈ


πŸŽ€ SYNOPSIS πŸŽ€

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

int ioctl(int fd, NS_GET_NSTYPE);

like literally copy that, it's the whole vibe πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

So <hotpink>NS_GET_NSTYPE</hotpink> is the operation you use when you have a file descriptor and you're like "bestie, what KIND of namespace are you??" β€” and it tells you. 🫢

The file descriptor in question is fd, and it refers to a /proc/pid/ns/* file. That's it. That's the vibe check. 🌈


⭐ RETURN VALUE ⭐

On success πŸŽ‰ β€” the return value is one of the <mint>CLONE_NEW*</mint> values. Yeah, the exact same crew you're allowed to specify to clone(2) or unshare(2) when you're creating a namespace in the first place. So it's giving "hi, here's my archetype" basically. πŸ‘‘

On error 😭 β€” -1 gets returned, and errno gets set to indicate the error. Classic. πŸ’€


πŸ’œ STANDARDS πŸ’œ

Linux. that's it, that's the standard. 🐧


πŸ‘‘ HISTORY πŸ‘‘

Dropped in <yellow>Linux 4.11</yellow>. ancient-ish. a little retro moment. ✨


πŸ’– SEE ALSO πŸ’–


mwah, that's the whole page, you ate it πŸ“

signing off with <purple>Linux man-pages 6.20</purple>, dated <cyan>2026-02-08</cyan> β€” catch you in the next namespace, bestie πŸ’…πŸ§šπŸ’œ

πŸ“¦ 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