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
- 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