mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: Alejandro Colomar <alx@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-kernel@vger.kernel.org, linux-man@vger.kernel.org
Subject: [PATCH] man/man2/setns.2: clarify type of nsfs fd required
Date: Sat, 13 Dec 2025 18:58:53 +0100	[thread overview]
Message-ID: <20251213175853.555517-1-hi@alyssa.is> (raw)

I was surprised to discover than an O_PATH file descriptor was
insufficient.  Since the mode of nsfs files is always 0444, tell
callers to always a file descriptor opened for reading.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
 man/man2/setns.2 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/man/man2/setns.2 b/man/man2/setns.2
index ea6a9c054..ed4937280 100644
--- a/man/man2/setns.2
+++ b/man/man2/setns.2
@@ -23,7 +23,7 @@ The
 .I fd
 argument is one of the following:
 .IP \[bu] 3
-a file descriptor referring to one of the magic links in a
+a file descriptor opened for reading one of the magic links in a
 .IR /proc/ pid /ns/
 directory (or a bind mount to such a link);
 .IP \[bu]
@@ -265,6 +265,12 @@ is set to indicate the error.
 .I fd
 is not a valid file descriptor.
 .TP
+.B EBADF
+.I fd
+is an
+.B O_PATH
+file descriptor.
+.TP
 .B EINVAL
 .I fd
 refers to a namespace whose type does not match that specified in

base-commit: 46950a0845de91c422efe6c639091ace42cb92f8
-- 
2.51.0


             reply	other threads:[~2025-12-13 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-13 17:58 Alyssa Ross [this message]
2025-12-13 18:44 ` Alejandro Colomar
2025-12-13 18:59   ` Alyssa Ross
2025-12-13 19:37     ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251213175853.555517-1-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=alx@kernel.org \
    --cc=brauner@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®