From: Alejandro Colomar <alx@kernel.org>
To: linux-man@vger.kernel.org
Cc: Alejandro Colomar <alx@kernel.org>,
aalbersh@kernel.org, linux-api@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: [RFC v2 6/8] man/man2/rename.2: Refer to at(2)
Date: Sat, 7 Nov 2026 13:48:10 +0100 [thread overview]
Message-ID: <8a5ac3f93ba5d2e70cb6fe94c6f5efb9ae44d4fc.1794055492.git.alx@kernel.org> (raw)
In-Reply-To: <cover.1794055492.git.alx@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 3188 bytes --]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
man/man2/rename.2 | 84 +++--------------------------------------------
1 file changed, 5 insertions(+), 79 deletions(-)
diff --git a/man/man2/rename.2 b/man/man2/rename.2
index 7e5c02797230..87f49ba851d7 100644
--- a/man/man2/rename.2
+++ b/man/man2/rename.2
@@ -16,10 +16,6 @@ .SH SYNOPSIS
.B #include <stdio.h>
.P
.BI "int rename(const char *" oldpath ", const char *" newpath );
-.P
-.BR "#include <fcntl.h> " "/* Definition of " AT_* " constants */"
-.B #include <stdio.h>
-.P
.BI "int renameat(int " olddirfd ", const char *" oldpath ,
.BI " int " newdirfd ", const char *" newpath );
.BI "int renameat2(int " olddirfd ", const char *" oldpath ,
@@ -96,52 +92,10 @@ .SH DESCRIPTION
.I newpath
refers to a symbolic link, the link will be overwritten.
.SS renameat()
-The
+The file descriptor and path arguments of
.BR renameat ()
-system call operates in exactly the same way as
-.BR rename (),
-except for the differences described here.
-.P
-If the pathname given in
-.I oldpath
-is relative, then it is interpreted relative to the directory
-referred to by the file descriptor
-.I olddirfd
-(rather than relative to the current working directory of
-the calling process, as is done by
-.BR rename ()
-for a relative pathname).
-.P
-If
-.I oldpath
-is relative and
-.I olddirfd
-is the special value
-.BR AT_FDCWD ,
-then
-.I oldpath
-is interpreted relative to the current working
-directory of the calling process (like
-.BR rename ()).
-.P
-If
-.I oldpath
-is absolute, then
-.I olddirfd
-is ignored.
-.P
-The interpretation of
-.I newpath
-is as for
-.IR oldpath ,
-except that a relative pathname is interpreted relative
-to the directory referred to by the file descriptor
-.IR newdirfd .
-.P
-See
-.BR openat (2)
-for an explanation of the need for
-.BR renameat ().
+are interpreted as specified in
+.BR at (2).
.SS renameat2()
.BR renameat2 ()
has an additional
@@ -274,25 +228,20 @@ .SH RETURN VALUE
.I errno
is set to indicate the error.
.SH ERRORS
+See
+.BR at (2).
.TP
.B EACCES
Write permission is denied for the directory containing
.I oldpath
or
.IR newpath ,
-or, search permission is denied for one of the directories
-in the path prefix of
-.I oldpath
-or
-.IR newpath ,
or
.I oldpath
is a directory and does not allow write permission (needed to update
the
.I ..
entry).
-(See also
-.BR path_resolution (7).)
.TP
.B EBUSY
The rename fails because
@@ -411,29 +360,6 @@ .SH ERRORS
even if the same filesystem is mounted on both.)
.P
The following additional errors can occur for
-.BR renameat ()
-and
-.BR renameat2 ():
-.TP
-.B EBADF
-.I oldpath
-.RI ( newpath )
-is relative but
-.I olddirfd
-.RI ( newdirfd )
-is not a valid file descriptor.
-.TP
-.B ENOTDIR
-.I oldpath
-is relative and
-.I olddirfd
-is a file descriptor referring to a file other than a directory;
-or similar for
-.I newpath
-and
-.I newdirfd
-.P
-The following additional errors can occur for
.BR renameat2 ():
.TP
.B EEXIST
--
2.55.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-11-07 12:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 17:40 [RFC v1] man/man2/at.2: Add page Alejandro Colomar
2026-10-23 17:42 ` Alejandro Colomar
2026-10-23 17:45 ` Alejandro Colomar
2026-10-26 12:27 ` Andrey Albershteyn
2026-10-26 15:42 ` Alejandro Colomar
2026-10-27 8:10 ` Andrey Albershteyn
2026-11-07 12:47 ` [RFC v2 0/8] Add at(2) manual page, and refer to it Alejandro Colomar
2026-11-07 12:47 ` [RFC v2 1/8] man/man3const/_ATFILE_SOURCE.3const: Add page Alejandro Colomar
2026-11-07 12:47 ` [RFC v2 2/8] man/man2/at.2: Add link page Alejandro Colomar
2026-11-07 12:47 ` [RFC v2 3/8] man/man2/chown.2: Refer to at(2) Alejandro Colomar
2026-11-07 12:48 ` [RFC v2 4/8] man/man2/mount_setattr.2: " Alejandro Colomar
2026-11-09 16:07 ` Andrey Albershteyn
2026-11-07 12:48 ` [RFC v2 5/8] man/man2/open_tree.2: " Alejandro Colomar
2026-11-09 16:12 ` Andrey Albershteyn
2026-11-07 12:48 ` Alejandro Colomar [this message]
2026-11-07 12:48 ` [RFC v2 7/8] man/man3const/_ATFILE_SOURCE.3const: Some functions report ESRCH instead of EACCES Alejandro Colomar
2026-11-07 12:48 ` [RFC v2 8/8] man/man2/utimensat.2: Refer to at(2) 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=8a5ac3f93ba5d2e70cb6fe94c6f5efb9ae44d4fc.1794055492.git.alx@kernel.org \
--to=alx@kernel.org \
--cc=aalbersh@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@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