linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aleksa Sarai <cyphar@cyphar.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org, Alexey Gladkov <legion@kernel.org>,
	 Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Aleksa Sarai <cyphar@cyphar.com>
Subject: [PATCH] chmod.2: document fchmodat(AT_EMPTY_PATH)
Date: Thu, 19 Jun 2025 04:34:30 +1000	[thread overview]
Message-ID: <20250619-fchmod-empty-path-v1-1-feff2c63abe4@cyphar.com> (raw)

The documentation and behaviour is indentical to the equivalent flag for
fchownat(2).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
---
This was added back in 2023, but I forgot to send the documentation
patch for this and only noticed when I was trying to use it and realised
it wasn't in the man page -- mea culpa!
---
 man/man2/chmod.2 | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/man/man2/chmod.2 b/man/man2/chmod.2
index 307589481593..671e256ba525 100644
--- a/man/man2/chmod.2
+++ b/man/man2/chmod.2
@@ -190,7 +190,30 @@ is absolute, then
 is ignored.
 .P
 .I flags
-can either be 0, or include the following flag:
+can either be 0, or include the following flags:
+.TP
+.BR AT_EMPTY_PATH " (since Linux 6.6)"
+.\" commit 5daeb41a6fc9d0d81cb2291884b7410e062d8fa1
+If
+.I path
+is an empty string, operate on the file referred to by
+.I dirfd
+(which may have been obtained using the
+.BR open (2)
+.B O_PATH
+flag).
+In this case,
+.I dirfd
+can refer to any type of file, not just a directory.
+If
+.I dirfd
+is
+.BR AT_FDCWD ,
+the call operates on the current working directory.
+This flag is Linux-specific; define
+.B _GNU_SOURCE
+.\" Before glibc 2.16, defining _ATFILE_SOURCE sufficed
+to obtain its definition.
 .TP
 .B AT_SYMLINK_NOFOLLOW
 If

---
base-commit: 471c38fb3c5c53c6df2fad4a7353559b330c1323
change-id: 20250619-fchmod-empty-path-7680e8bb5481

Best regards,
-- 
Aleksa Sarai <cyphar@cyphar.com>


             reply	other threads:[~2025-06-18 18:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18 18:34 Aleksa Sarai [this message]
2025-06-19  0:07 ` [PATCH] chmod.2: document fchmodat(AT_EMPTY_PATH) 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=20250619-fchmod-empty-path-v1-1-feff2c63abe4@cyphar.com \
    --to=cyphar@cyphar.com \
    --cc=alx@kernel.org \
    --cc=brauner@kernel.org \
    --cc=legion@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).