aboutsummaryrefslogtreecommitdiffstats
path: root/man2
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2021-08-12 04:05:59 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2021-08-12 05:45:21 +0200
commit9f4e736ad072ee9b539fa55a6eeb012b98cdded7 (patch)
tree408e879b0440446862024bd8a36f92b9b0c9b42b /man2
parent38a350061eead6bf6d22db413f8d6b2fbcf08c96 (diff)
downloadman-pages-9f4e736ad072ee9b539fa55a6eeb012b98cdded7.tar.gz
access.2, chmod.2, chown.2, execveat.2, futimesat.2, link.2, mkdir.2, mknod.2, mount_setattr.2, open.2, open_by_handle_at.2, readlink.2, rename.2, stat.2, statx.2, symlink.2, unlink.2, utimensat.2, mkfifo.3, scandir.3: Fix EBADF error description
Make the description of the EBADF error for invalid 'dirfd' more uniform. In particular, note that the error only occurs when the pathname is relative, and that it occurs when the 'dirfd' is neither valid *nor* has the value AT_FDCWD. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man2')
-rw-r--r--man2/access.26
-rw-r--r--man2/chmod.26
-rw-r--r--man2/chown.26
-rw-r--r--man2/execveat.27
-rw-r--r--man2/futimesat.26
-rw-r--r--man2/link.210
-rw-r--r--man2/mkdir.26
-rw-r--r--man2/mknod.26
-rw-r--r--man2/mount_setattr.26
-rw-r--r--man2/open.26
-rw-r--r--man2/open_by_handle_at.26
-rw-r--r--man2/readlink.26
-rw-r--r--man2/rename.26
-rw-r--r--man2/stat.26
-rw-r--r--man2/statx.26
-rw-r--r--man2/symlink.26
-rw-r--r--man2/unlink.26
-rw-r--r--man2/utimensat.22
18 files changed, 86 insertions, 23 deletions
diff --git a/man2/access.2 b/man2/access.2
index 3957a2ab88..0fb2a79f7f 100644
--- a/man2/access.2
+++ b/man2/access.2
@@ -278,8 +278,12 @@ The following additional errors can occur for
.BR faccessat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
diff --git a/man2/chmod.2 b/man2/chmod.2
index 017aab9d63..6862a7e3d2 100644
--- a/man2/chmod.2
+++ b/man2/chmod.2
@@ -309,8 +309,12 @@ The following additional errors can occur for
.BR fchmodat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
diff --git a/man2/chown.2 b/man2/chown.2
index e35587b28a..354193c283 100644
--- a/man2/chown.2
+++ b/man2/chown.2
@@ -293,8 +293,12 @@ The following additional errors can occur for
.BR fchownat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
diff --git a/man2/execveat.2 b/man2/execveat.2
index 495617b090..ad952631c6 100644
--- a/man2/execveat.2
+++ b/man2/execveat.2
@@ -121,9 +121,12 @@ can also occur for
The following additional errors can occur for
.BR execveat ():
.TP
-.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
diff --git a/man2/futimesat.2 b/man2/futimesat.2
index 86e941fe59..c82e4014c9 100644
--- a/man2/futimesat.2
+++ b/man2/futimesat.2
@@ -99,8 +99,12 @@ The following additional errors can occur for
.BR futimesat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B ENOTDIR
.I pathname
diff --git a/man2/link.2 b/man2/link.2
index c285ae8962..2c90576539 100644
--- a/man2/link.2
+++ b/man2/link.2
@@ -282,10 +282,14 @@ The following additional errors can occur for
.BR linkat ():
.TP
.B EBADF
+.I oldpath
+.RI ( newpath )
+is relative but
.I olddirfd
-or
-.I newdirfd
-is not a valid file descriptor.
+.RI ( newdirfd )
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EINVAL
An invalid flag value was specified in
diff --git a/man2/mkdir.2 b/man2/mkdir.2
index e4d7d9472f..355ba086e7 100644
--- a/man2/mkdir.2
+++ b/man2/mkdir.2
@@ -192,8 +192,12 @@ The following additional errors can occur for
.BR mkdirat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B ENOTDIR
.I pathname
diff --git a/man2/mknod.2 b/man2/mknod.2
index 1de3cd027a..f5bb0900af 100644
--- a/man2/mknod.2
+++ b/man2/mknod.2
@@ -229,8 +229,12 @@ The following additional errors can occur for
.BR mknodat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B ENOTDIR
.I pathname
diff --git a/man2/mount_setattr.2 b/man2/mount_setattr.2
index 81dc4856b9..24cd363824 100644
--- a/man2/mount_setattr.2
+++ b/man2/mount_setattr.2
@@ -408,8 +408,12 @@ is set to indicate the cause of the error.
.SH ERRORS
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EBADF
.I userns_fd
diff --git a/man2/open.2 b/man2/open.2
index bfc1b2f6b9..7c0e9cd2e9 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -1290,8 +1290,12 @@ The following additional errors can occur for
.BR openat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B ENOTDIR
.I pathname
diff --git a/man2/open_by_handle_at.2 b/man2/open_by_handle_at.2
index f3fa2a4f44..9e33f5753c 100644
--- a/man2/open_by_handle_at.2
+++ b/man2/open_by_handle_at.2
@@ -349,9 +349,11 @@ is not an open file descriptor.
.TP
.B EBADF
.I pathname
-is relative and
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EFAULT
.IR handle
diff --git a/man2/readlink.2 b/man2/readlink.2
index 7387ee4e01..6ae07c3852 100644
--- a/man2/readlink.2
+++ b/man2/readlink.2
@@ -200,8 +200,12 @@ The following additional errors can occur for
.BR readlinkat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B ENOTDIR
.I pathname
diff --git a/man2/rename.2 b/man2/rename.2
index dfde1ce6d3..a5dbd55bac 100644
--- a/man2/rename.2
+++ b/man2/rename.2
@@ -438,9 +438,11 @@ and
.BR renameat2 ():
.TP
.B EBADF
+.I oldpath
+.RI ( newpath )
+is relative but
.I olddirfd
-or
-.I newdirfd
+.RI ( newdirfd )
is not a valid file descriptor.
.TP
.B ENOTDIR
diff --git a/man2/stat.2 b/man2/stat.2
index 339920d711..e5859abaff 100644
--- a/man2/stat.2
+++ b/man2/stat.2
@@ -434,8 +434,12 @@ The following additional errors can occur for
.BR fstatat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
diff --git a/man2/statx.2 b/man2/statx.2
index 62e86fb1b5..85b23dd59c 100644
--- a/man2/statx.2
+++ b/man2/statx.2
@@ -505,8 +505,12 @@ in the path prefix of
.BR path_resolution (7).)
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid open file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EFAULT
.I pathname
diff --git a/man2/symlink.2 b/man2/symlink.2
index 87c25d5f48..83d29d3e94 100644
--- a/man2/symlink.2
+++ b/man2/symlink.2
@@ -203,8 +203,12 @@ The following additional errors can occur for
.BR symlinkat ():
.TP
.B EBADF
+.I linkpath
+is relative but
.I newdirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B ENOENT
.I linkpath
diff --git a/man2/unlink.2 b/man2/unlink.2
index 6f4c187f8a..dbb17ea756 100644
--- a/man2/unlink.2
+++ b/man2/unlink.2
@@ -246,8 +246,12 @@ The following additional errors can occur for
.BR unlinkat ():
.TP
.B EBADF
+.I pathname
+is relative but
.I dirfd
-is not a valid file descriptor.
+is neither
+.B AT_FDCWD
+nor a valid file descriptor.
.TP
.B EINVAL
An invalid flag value was specified in
diff --git a/man2/utimensat.2 b/man2/utimensat.2
index 006677db88..4ef7be7b8a 100644
--- a/man2/utimensat.2
+++ b/man2/utimensat.2
@@ -269,7 +269,7 @@ is not a valid file descriptor.
.B EBADF
.RB ( utimensat ())
.I pathname
-is a relative pathname, but
+is relative but
.I dirfd
is neither
.BR AT_FDCWD