[v2,3/5] manual: Document renameat

Message ID 20250106163257.705106-4-arjun@redhat.com (mailing list archive)
State New
Headers
Series manual: Document several *at file system interface functions |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed

Commit Message

Arjun Shankar Jan. 6, 2025, 4:26 p.m. UTC
  ---
 manual/filesys.texi | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
  

Comments

Florian Weimer Jan. 8, 2025, 8:36 a.m. UTC | #1
* Arjun Shankar:

> ---
>  manual/filesys.texi | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/manual/filesys.texi b/manual/filesys.texi
> index e92730209c..776b98fe7f 100644
> --- a/manual/filesys.texi
> +++ b/manual/filesys.texi
> @@ -1826,6 +1826,28 @@ file systems.
>  @end table
>  @end deftypefun
>  
> +@deftypefun int renameat (int @var{oldfiledes}, const char *@var{oldname}, int @var{newfiledes}, const char *@var{newname})
> +@standards{POSIX.1-2008, stdio.h}
> +@comment Unaudited and therefore marked AC-Unsafe and AS-Unsafe by default
> +@safety{@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
> +This function is a descriptor-relative version of the @code{rename}
> +function above.  @xref{Descriptor-Relative Access}.
> +
> +Compared to @code{rename}, the following additional error conditions can
> +occur:
> +
> +@table @code
> +@item EBADF
> +The @var{oldfiledes} and/or @var{newfiledes} arguments are not valid file
> +descriptors.

Should mention AT_FDCWD.  And this apparently only applies when the
corresponding paths are relative (as for all *at functions).

> +@item ENOTDIR
> +The descriptor @var{oldfiledes} is not associated with a directory, and
> +@var{oldname} is a relative file name, or correspondingly similar condition
> +for @var{newfiledes} and @var{newname}.
> +@end table
> +@end deftypefun

Likewise.

Thanks,
Florian
  

Patch

diff --git a/manual/filesys.texi b/manual/filesys.texi
index e92730209c..776b98fe7f 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -1826,6 +1826,28 @@  file systems.
 @end table
 @end deftypefun
 
+@deftypefun int renameat (int @var{oldfiledes}, const char *@var{oldname}, int @var{newfiledes}, const char *@var{newname})
+@standards{POSIX.1-2008, stdio.h}
+@comment Unaudited and therefore marked AC-Unsafe and AS-Unsafe by default
+@safety{@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}}
+This function is a descriptor-relative version of the @code{rename}
+function above.  @xref{Descriptor-Relative Access}.
+
+Compared to @code{rename}, the following additional error conditions can
+occur:
+
+@table @code
+@item EBADF
+The @var{oldfiledes} and/or @var{newfiledes} arguments are not valid file
+descriptors.
+
+@item ENOTDIR
+The descriptor @var{oldfiledes} is not associated with a directory, and
+@var{oldname} is a relative file name, or correspondingly similar condition
+for @var{newfiledes} and @var{newname}.
+@end table
+@end deftypefun
+
 @node Creating Directories
 @section Creating Directories
 @cindex creating a directory
@@ -3830,7 +3852,6 @@  The @code{mkdtemp} function comes from OpenBSD.
 @c openat
 @c open_by_handle_at
 @c readlinkat
-@c renameat
 @c renameat2
 @c scandirat
 @c symlinkat