[RFC v2 5/8] man/man2/open_tree.2: Refer to at(2)

From
Alejandro Colomar <alx@kernel.org>
Date
2026-11-07 12:48:09
Also in
linux-fsdevel, linux-man
Reply to
Alejandro Colomar, 2026-11-07
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
 man/man2/open_tree.2 | 168 +++----------------------------------------
 1 file changed, 8 insertions(+), 160 deletions(-)
diff --git a/man/man2/open_tree.2 b/man/man2/open_tree.2
index 3e587f7be14b..9afca6ef91a2 100644
--- a/man/man2/open_tree.2
+++ b/man/man2/open_tree.2
@@ -115,110 +115,17 @@ .SH DESCRIPTION
 is included in
 .IR flags .
 .P
-As with "*at()" system calls,
-.BR open_tree ()
-uses the
-.I dirfd
-argument in conjunction with the
-.I path
-argument to determine the path to operate on, as follows:
-.IP \[bu] 3
-If the pathname given in
-.I path
-is absolute, then
-.I dirfd
-is ignored.
-.IP \[bu]
-If the pathname given in
-.I path
-is relative and
-.I dirfd
-is the special value
-.BR \%AT_FDCWD ,
-then
-.I path
-is interpreted relative to
-the current working directory
-of the calling process (like
-.BR open (2)).
-.IP \[bu]
-If the pathname given in
-.I path
-is relative,
-then it is interpreted relative to
-the directory referred to by the file descriptor
-.I dirfd
-(rather than relative to
-the current working directory
-of the calling process,
-as is done by
-.BR open (2)
-for a relative pathname).
-In this case,
-.I dirfd
-must be a directory
-that was opened for reading
-.RB ( \%O_RDONLY )
-or using the
-.B O_PATH
-flag.
-.IP \[bu]
-If
-.I path
-is an empty string,
+.IR dirfd ,
+.IR path ,
 and
 .I flags
-contains
-.BR \%AT_EMPTY_PATH ,
-then the file descriptor
-.I dirfd
-is operated on directly.
-In this case,
-.I dirfd
-may refer to any type of file,
-not just a directory.
-.P
-See
-.BR openat (2)
-for an explanation of why the
-.I dirfd
-argument is useful.
-.P
+are interpreted as specified in
+.BR at (2),
+but
 .I flags
-can be used to control aspects of the path lookup
-and properties of the returned file descriptor.
-A value for
-.I flags
-is constructed by bitwise ORing
-zero or more of the following constants:
+accepts some more values:
 .RS
 .TP
-.B \%AT_EMPTY_PATH
-If
-.I path
-is an empty string, operate on the file referred to by
-.I dirfd
-(which may have been obtained from
-.BR open (2),
-.BR fsmount (2),
-or from another
-.BR open_tree ()
-call).
-In this case,
-.I dirfd
-may refer to any type of file, not just a directory.
-If
-.I dirfd
-is
-.BR \%AT_FDCWD ,
-.BR open_tree ()
-will operate on the current working directory
-of the calling process.
-This flag is Linux-specific;
-define
-.B \%_GNU_SOURCE
-to obtain its definition.
-.TP
 .B \%AT_NO_AUTOMOUNT
 Do not automount the terminal ("basename") component of
 .I path
@@ -231,18 +138,6 @@ .SH DESCRIPTION
 .B \%_GNU_SOURCE
 to obtain its definition.
 .TP
-.B \%AT_SYMLINK_NOFOLLOW
-If
-.I path
-is a symbolic link, do not dereference it;
-instead,
-create either a handle to the link itself
-or a bind-mount of it.
-The resultant file descriptor is indistinguishable from one produced by
-.BR openat (2)
-with
-.BR \%O_PATH | O_NOFOLLLOW .
-.TP
 .B \%OPEN_TREE_CLOEXEC
 Set the close-on-exec
 .RB ( FD_CLOEXEC )
@@ -404,21 +299,8 @@ .SH RETURN VALUE
 .I errno
 is set to indicate the error.
 .SH ERRORS
-.TP
-.B EACCES
-Search permission is denied for one of the directories
-in the path prefix of
-.IR path .
-(See also
-.BR path_resolution (7).)
-.TP
-.B EBADF
-.I path
-is relative but
-.I dirfd
-is neither
-.B \%AT_FDCWD
-nor a valid file descriptor.
+See
+.BR at (2).
 .TP
 .B EFAULT
 .I path
@@ -426,46 +308,12 @@ .SH ERRORS
 or a pointer to a location
 outside the calling process's accessible address space.
 .TP
-.B EINVAL
-Invalid flag specified in
-.IR flags .
-.TP
-.B ELOOP
-Too many symbolic links encountered when resolving
-.IR path .
-.TP
 .B EMFILE
 The calling process has too many open files to create more.
 .TP
-.B ENAMETOOLONG
-.I path
-is longer than
-.BR PATH_MAX .
-.TP
 .B ENFILE
 The system has too many open files to create more.
 .TP
-.B ENOENT
-A component of
-.I path
-does not exist, or is a dangling symbolic link.
-.TP
-.B ENOENT
-.I path
-is an empty string, but
-.B AT_EMPTY_PATH
-is not specified in
-.IR flags .
-.TP
-.B ENOTDIR
-A component of the path prefix of
-.I path
-is not a directory, or
-.I path
-is relative and
-.I dirfd
-is a file descriptor referring to a file other than a directory.
-.TP
 .B ENOSPC
 The "anonymous" mount namespace
 necessary to contain the
-- 
2.55.0

Attachments

Thread (17 messages) 17 messages, 3 authors, last reply 8d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help