| 1 |
.\" Copyright 2017, Michael Kerrisk <[email protected]> |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 5 |
.\" |
| 6 |
.TH NS_GET_NSTYPE 2const 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
NS_GET_NSTYPE |
| 9 |
\- |
| 10 |
discovering the namespace type |
| 11 |
.SH SYNOPSIS |
| 12 |
.nf |
| 13 |
.BR "#include <linux/nsfs.h>" " /* Definition of " NS_GET_NSTYPE " */" |
| 14 |
.B #include <sys/ioctl.h> |
| 15 |
.P |
| 16 |
.BI "int ioctl(int " fd ", NS_GET_NSTYPE);" |
| 17 |
.fi |
| 18 |
.SH DESCRIPTION |
| 19 |
The |
| 20 |
.B NS_GET_NSTYPE |
| 21 |
operation can be used to discover |
| 22 |
the type of namespace referred to by the file descriptor |
| 23 |
.IR fd . |
| 24 |
.P |
| 25 |
.I fd |
| 26 |
refers to a |
| 27 |
.IR /proc/ pid /ns/* |
| 28 |
file. |
| 29 |
.SH RETURN VALUE |
| 30 |
On success, |
| 31 |
the return value is one of the |
| 32 |
.B CLONE_NEW* |
| 33 |
values that can be specified to |
| 34 |
.BR clone (2) |
| 35 |
or |
| 36 |
.BR unshare (2) |
| 37 |
in order to create a namespace. |
| 38 |
.P |
| 39 |
On error, |
| 40 |
\-1 is returned, and |
| 41 |
.I errno |
| 42 |
is set to indicate the error. |
| 43 |
.SH STANDARDS |
| 44 |
Linux. |
| 45 |
.SH HISTORY |
| 46 |
Linux 4.11. |
| 47 |
.\" linux.git e5ff5ce6e20ee22511398bb31fb912466cf82a36 |
| 48 |
.SH SEE ALSO |
| 49 |
.BR ioctl (2), |
| 50 |
.BR ioctl_nsfs (2) |