aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-06-11 02:18:22 +0200
committerAlejandro Colomar <alx@kernel.org>2024-06-13 23:54:51 +0200
commita660bbdd85ebf434f36df0004e88a1abcc63a804 (patch)
treefe829283ff555431c359b8197354254ec2a00a4b
parent38658f54478947ec7ed8f86bdf787c32cb78822a (diff)
parent2f857efc374e1c52a2084c77bf52b06ac371b129 (diff)
downloadman-pages-a660bbdd85ebf434f36df0004e88a1abcc63a804.tar.gz
ioctl_ns.2, ioctl_nsfs.2: Rename page, and make sashimi
-rw-r--r--man/man2/ioctl.22
-rw-r--r--man/man2/ioctl_nsfs.247
-rw-r--r--man/man2const/NS_GET_NSTYPE.2const50
-rw-r--r--man/man2const/NS_GET_OWNER_UID.2const52
-rw-r--r--man/man2const/NS_GET_PARENT.2const1
-rw-r--r--man/man2const/NS_GET_USERNS.2const (renamed from man/man2/ioctl_ns.2)132
-rw-r--r--man/man7/namespaces.74
-rw-r--r--man/man7/pid_namespaces.72
-rw-r--r--man/man7/user_namespaces.76
9 files changed, 191 insertions, 105 deletions
diff --git a/man/man2/ioctl.2 b/man/man2/ioctl.2
index dd6717b434..5a19bd4d72 100644
--- a/man/man2/ioctl.2
+++ b/man/man2/ioctl.2
@@ -218,7 +218,7 @@ for the various architectures.
.BR ioctl_fat (2),
.BR ioctl_fs (2),
.BR ioctl_getfsmap (2),
-.BR ioctl_ns (2),
+.BR ioctl_nsfs (2),
.BR ioctl_tty (2),
.BR ioctl_userfaultfd (2),
.BR ioctl_eventpoll (2),
diff --git a/man/man2/ioctl_nsfs.2 b/man/man2/ioctl_nsfs.2
new file mode 100644
index 0000000000..4c728ba993
--- /dev/null
+++ b/man/man2/ioctl_nsfs.2
@@ -0,0 +1,47 @@
+.\" Copyright 2017, Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH ioctl_nsfs 2 (date) "Linux man-pages (unreleased)"
+.SH NAME
+ioctl_nsfs
+\-
+ioctl() operations for Linux namespaces
+.SH SYNOPSIS
+.nf
+.BR "#include <linux/nsfs.h>" " /* Definition of " NS_* " constants */"
+.B #include <sys/ioctl.h>
+.P
+.BI "int ioctl(int " fd ", unsigned long " op ", ...);"
+.fi
+.SH DESCRIPTION
+.SS Discovering namespace relationships
+.TP
+.B NS_GET_USERNS
+.TQ
+.B NS_GET_PARENT
+.SS Discovering the namespace type
+.TP
+.B NS_GET_NSTYPE
+.SS Discovering the owner of a user namespace
+.TP
+.B NS_GET_OWNER_UID
+.SH ERRORS
+.TP
+.B ENOTTY
+.I fd
+does not refer to a
+.IR /proc/ pid /ns/ *
+file.
+.SH STANDARDS
+Linux.
+.SH SEE ALSO
+.BR ioctl (2),
+.BR NS_GET_USERNS (2const),
+.BR NS_GET_PARENT (2const),
+.BR NS_GET_NSTYPE (2const),
+.BR NS_GET_OWNER_UID (2const),
+.BR fstat (2),
+.BR proc (5),
+.BR namespaces (7)
diff --git a/man/man2const/NS_GET_NSTYPE.2const b/man/man2const/NS_GET_NSTYPE.2const
new file mode 100644
index 0000000000..5208fe214d
--- /dev/null
+++ b/man/man2const/NS_GET_NSTYPE.2const
@@ -0,0 +1,50 @@
+.\" Copyright 2017, Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH NS_GET_NSTYPE 2const (date) "Linux man-pages (unreleased)"
+.SH NAME
+NS_GET_NSTYPE
+\-
+discovering the namespace type
+.SH SYNOPSIS
+.nf
+.BR "#include <linux/nsfs.h>" " /* Definition of " NS_GET_NSTYPE " */"
+.B #include <sys/ioctl.h>
+.P
+.BI "int ioctl(int " fd ", NS_GET_NSTYPE);"
+.fi
+.SH DESCRIPTION
+The
+.B NS_GET_NSTYPE
+operation can be used to discover
+the type of namespace referred to by the file descriptor
+.IR fd .
+.P
+.I fd
+refers to a
+.IR /proc/ pid /ns/*
+file.
+.SH RETURN VALUE
+On success,
+the return value is one of the
+.B CLONE_NEW*
+values that can be specified to
+.BR clone (2)
+or
+.BR unshare (2)
+in order to create a namespace.
+.P
+On error,
+\-1 is returned, and
+.I errno
+is set to indicate the error.
+.SH STANDARDS
+Linux.
+.SH HISTORY
+Linux 4.11.
+.\" linux.git e5ff5ce6e20ee22511398bb31fb912466cf82a36
+.SH SEE ALSO
+.BR ioctl (2),
+.BR ioctl_nsfs (2)
diff --git a/man/man2const/NS_GET_OWNER_UID.2const b/man/man2const/NS_GET_OWNER_UID.2const
new file mode 100644
index 0000000000..f64d607bb4
--- /dev/null
+++ b/man/man2const/NS_GET_OWNER_UID.2const
@@ -0,0 +1,52 @@
+.\" Copyright 2017, Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH NS_GET_OWNER_UID 2const (date) "Linux man-pages (unreleased)"
+.SH NAME
+NS_GET_OWNER_UID
+\-
+discovering the owner of a user namespace
+.SH SYNOPSIS
+.nf
+.BR "#include <linux/nsfs.h>" " /* Definition of " NS_GET_OWNER_UID " */"
+.B #include <sys/ioctl.h>
+.P
+.BI "int ioctl(int " fd ", NS_GET_OWNER_UID, uid_t *" uid );
+.fi
+.SH DESCRIPTION
+The
+.B NS_GET_OWNER_UID
+operation can be used to discover
+the owner user ID of a user namespace (i.e., the effective user ID
+of the process that created the user namespace).
+.P
+.I fd
+refers to a
+.IR /proc/ pid /ns/user
+file.
+.P
+The owner user ID is returned in the
+.I uid_t
+pointed to by the third argument.
+.SH RETURN VALUE
+On success,
+0 is returned.
+On error,
+\-1 is returned, and
+.I errno
+is set to indicate the error.
+.SH ERRORS
+.TP
+.B EINVAL
+.I fd
+does not refer to a user namespace.
+.SH STANDARDS
+Linux.
+.SH HISTORY
+Linux 4.11.
+.\" linux.git 015bb305b8ebe8d601a238ab70ebdc394c7a19ba
+.SH SEE ALSO
+.BR ioctl (2),
+.BR ioctl_nsfs (2)
diff --git a/man/man2const/NS_GET_PARENT.2const b/man/man2const/NS_GET_PARENT.2const
new file mode 100644
index 0000000000..3144fb463f
--- /dev/null
+++ b/man/man2const/NS_GET_PARENT.2const
@@ -0,0 +1 @@
+.so man2const/NS_GET_USERNS.2const
diff --git a/man/man2/ioctl_ns.2 b/man/man2const/NS_GET_USERNS.2const
index 958a686b09..68a2b45dcf 100644
--- a/man/man2/ioctl_ns.2
+++ b/man/man2const/NS_GET_USERNS.2const
@@ -1,28 +1,28 @@
-.\" Copyright (c) 2017 by Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Copyright 2017, Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.\"
-.TH ioctl_ns 2 (date) "Linux man-pages (unreleased)"
+.TH NS_GET_USERNS 2const (date) "Linux man-pages (unreleased)"
.SH NAME
-ioctl_ns \- ioctl() operations for Linux namespaces
+NS_GET_USERNS,
+NS_GET_PARENT
+\-
+discovering namespace relationships
+.SH SYNOPSIS
+.nf
+.BR "#include <linux/nsfs.h>" " /* Definition of " NS_GET_* " constants */"
+.B #include <sys/ioctl.h>
+.P
+.BI "int ioctl(int " fd ", unsigned long " op );
+.fi
.SH DESCRIPTION
-.\" ============================================================
-.\"
-.SS Discovering namespace relationships
The following
.BR ioctl (2)
operations are provided to allow discovery of namespace relationships (see
.BR user_namespaces (7)
and
.BR pid_namespaces (7)).
-The form of the calls is:
-.P
-.in +4n
-.EX
-new_fd = ioctl(fd, op);
-.EE
-.in
.P
In each case,
.I fd
@@ -31,15 +31,12 @@ refers to a
file.
Both operations return a new file descriptor on success.
.TP
-.BR NS_GET_USERNS " (since Linux 4.9)"
-.\" commit bcac25a58bfc6bd79191ac5d7afb49bea96da8c9
-.\" commit 6786741dbf99e44fb0c0ed85a37582b8a26f1c3b
+.B NS_GET_USERNS
Returns a file descriptor that refers to the owning user namespace
for the namespace referred to by
.IR fd .
.TP
-.BR NS_GET_PARENT " (since Linux 4.9)"
-.\" commit a7306ed8d94af729ecef8b6e37506a1c6fc14788
+.B NS_GET_PARENT
Returns a file descriptor that refers to the parent namespace of
the namespace referred to by
.IR fd .
@@ -70,10 +67,13 @@ structure whose
This inode number can be matched with the inode number of another
.IR /proc/ pid /ns/ { pid , user }
file to determine whether that is the owning/parent namespace.
-.P
-Either of these
-.BR ioctl (2)
-operations can fail with the following errors:
+.SH RETURN VALUE
+On success,
+a file descriptor is returned.
+Or error, \-1 is returned, and
+.I errno
+is set to indicate the error.
+.SH ERRORS
.TP
.B EPERM
The requested namespace is outside of the caller's namespace scope.
@@ -92,80 +92,18 @@ operation can fail with the following error:
.B EINVAL
.I fd
refers to a nonhierarchical namespace.
-.P
-See the EXAMPLES section for an example of the use of these operations.
-.\" ============================================================
-.\"
-.SS Discovering the namespace type
-The
-.B NS_GET_NSTYPE
-.\" commit e5ff5ce6e20ee22511398bb31fb912466cf82a36
-operation (available since Linux 4.11) can be used to discover
-the type of namespace referred to by the file descriptor
-.IR fd :
-.P
-.in +4n
-.EX
-nstype = ioctl(fd, NS_GET_NSTYPE);
-.EE
-.in
-.P
-.I fd
-refers to a
-.IR /proc/ pid /ns/*
-file.
-.P
-The return value is one of the
-.B CLONE_NEW*
-values that can be specified to
-.BR clone (2)
-or
-.BR unshare (2)
-in order to create a namespace.
-.\" ============================================================
-.\"
-.SS Discovering the owner of a user namespace
-The
-.B NS_GET_OWNER_UID
-.\" commit 015bb305b8ebe8d601a238ab70ebdc394c7a19ba
-operation (available since Linux 4.11) can be used to discover
-the owner user ID of a user namespace (i.e., the effective user ID
-of the process that created the user namespace).
-The form of the call is:
-.P
-.in +4n
-.EX
-uid_t uid;
-ioctl(fd, NS_GET_OWNER_UID, &uid);
-.EE
-.in
-.P
-.I fd
-refers to a
-.IR /proc/ pid /ns/user
-file.
-.P
-The owner user ID is returned in the
-.I uid_t
-pointed to by the third argument.
-.P
-This operation can fail with the following error:
-.TP
-.B EINVAL
-.I fd
-does not refer to a user namespace.
-.SH ERRORS
-Any of the above
-.BR ioctl ()
-operations can return the following errors:
-.TP
-.B ENOTTY
-.I fd
-does not refer to a
-.IR /proc/ pid /ns/ *
-file.
.SH STANDARDS
Linux.
+.SH HISTORY
+.TP
+.B NS_GET_USERNS
+.\" linux.git bcac25a58bfc6bd79191ac5d7afb49bea96da8c9
+.\" linux.git 6786741dbf99e44fb0c0ed85a37582b8a26f1c3b
+Linux 4.9.
+.TP
+.B NS_GET_PARENT
+.\" linux.git a7306ed8d94af729ecef8b6e37506a1c6fc14788
+Linux 4.9.
.SH EXAMPLES
The example shown below uses the
.BR ioctl (2)
@@ -336,7 +274,5 @@ main(int argc, char *argv[])
.EE
.\" SRC END
.SH SEE ALSO
-.BR fstat (2),
.BR ioctl (2),
-.BR proc (5),
-.BR namespaces (7)
+.BR ioctl_nsfs (2)
diff --git a/man/man7/namespaces.7 b/man/man7/namespaces.7
index bdcdde3c80..5cf0546658 100644
--- a/man/man7/namespaces.7
+++ b/man/man7/namespaces.7
@@ -107,7 +107,7 @@ Various
.BR ioctl (2)
operations can be used to discover information about namespaces.
These operations are described in
-.BR ioctl_ns (2).
+.BR ioctl_nsfs (2).
.P
Creation of new namespaces using
.BR clone (2)
@@ -400,7 +400,7 @@ and
.BR readlink (1),
.BR unshare (1),
.BR clone (2),
-.BR ioctl_ns (2),
+.BR ioctl_nsfs (2),
.BR setns (2),
.BR unshare (2),
.BR proc (5),
diff --git a/man/man7/pid_namespaces.7 b/man/man7/pid_namespaces.7
index c886a034d3..e7fb66c963 100644
--- a/man/man7/pid_namespaces.7
+++ b/man/man7/pid_namespaces.7
@@ -182,7 +182,7 @@ The
.BR ioctl (2)
operation can be used to discover the parental relationship
between PID namespaces; see
-.BR ioctl_ns (2).
+.BR ioctl_nsfs (2).
.\"
.\" ============================================================
.\"
diff --git a/man/man7/user_namespaces.7 b/man/man7/user_namespaces.7
index ddeb669c30..bd6720b0bb 100644
--- a/man/man7/user_namespaces.7
+++ b/man/man7/user_namespaces.7
@@ -90,7 +90,7 @@ The
.BR ioctl (2)
operation can be used to discover the parental relationship
between user namespaces; see
-.BR ioctl_ns (2).
+.BR ioctl_nsfs (2).
.P
A task that changes one of its effective IDs
will have its dumpability reset to the value in
@@ -218,7 +218,7 @@ The
.BR ioctl (2)
operation can be used to discover the user ID of the owner of the namespace;
see
-.BR ioctl_ns (2).
+.BR ioctl_nsfs (2).
.\"
.\" ============================================================
.\"
@@ -364,7 +364,7 @@ The
.BR ioctl (2)
operation can be used to discover the user namespace
that owns a nonuser namespace; see
-.BR ioctl_ns (2).
+.BR ioctl_nsfs (2).
.\"
.\" ============================================================
.\"