]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man2/statmount.2: Document req.mnt_ns_fd
authorBhavik Sachdev <b.sachdev1904@gmail.com>
Mon, 23 Feb 2026 14:10:25 +0000 (19:40 +0530)
committerAlejandro Colomar <alx@kernel.org>
Thu, 5 Mar 2026 17:11:38 +0000 (18:11 +0100)
Document the new mnt_ns_fd parameter to struct mnt_id_req.

req.mnt_ns_fd can be used to query for a mount in a foreign mount
namespace.

The mnt_ns_fd parameter description is based on this commit message [1].

Link [1]:
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9020d0d844ad58a051f90b1e5b82ba34123925b9>

Signed-off-by: Bhavik Sachdev <b.sachdev1904@gmail.com>
Message-ID: <6577568b31ba8700214af1696d740d3b6aa1869d.1771855135.git.b.sachdev1904@gmail.com>
Message-ID: <a250e5c44e03428b5817ee863ebe6b47977ec9ab.1771855680.git.b.sachdev1904@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man2/statmount.2

index be3aaaca7ea687a7b7942dce247a9dd283f974c4..5ac96796c150a594dd8705ccfbbc6014b6e4fe54 100644 (file)
@@ -24,6 +24,7 @@ Standard C library
 .EX
 .B struct mnt_id_req {
 .BR "    __u32  size;" "        /* sizeof(struct mnt_id_req) */"
+.BR "    __u32  mnt_ns_fd;" "   /* fd of mnt_ns to query the mnt_id in */"
 .BR "    __u64  mnt_id;" "      /* The mnt_id being queried */"
 .BR "    __u64  param;" "       /* ORed combination of the STATMOUNT_ constants */"
 .BR "    __u32  mnt_ns_id;" "   /* The id of mnt_ns to query the mnt_id in */"
@@ -74,7 +75,9 @@ necessitating the use of
 To access a mount's status,
 the caller must have CAP_SYS_ADMIN in the user namespace.
 In case of accessing a mount in a foreign mount namespace (specified via
-.IR req.mnt_ns_id ),
+.I req.mnt_ns_id
+or
+.IR req.mnt_ns_fd ),
 the foreign mount namespace should be child of the current namespace.
 .P
 This function returns information about a mount,
@@ -97,6 +100,16 @@ is being passed in;
 it should always be set to
 .IR sizeof(struct\~mnt_id_req) .
 .P
+.I req.mnt_ns_fd
+can be obtained from
+.B PIDFD_GET_MNT_NAMESPACE
+.BR ioctl (2)
+operation or by opening a file descriptor to
+.IR /proc/ pid /ns/mnt
+and is used to specify a foreign mount namespace in which to query
+.I req.mnt_id
+(since Linux 6.18).
+.P
 .I req.mnt_id
 can be obtained from either
 .BR statx (2)
@@ -372,6 +385,13 @@ Invalid flag specified in
 .I req
 is of insufficient size to be utilized.
 .TP
+.B EINVAL
+Both
+.I req.mnt_ns_id
+and
+.I req.mnt_ns_fd
+were set.
+.TP
 .B E2BIG
 .I req
 is too large.