[libc-commits] [libc] [libc][stdio] implement rename via SYS_renameat2 (PR #86140)

via libc-commits libc-commits at lists.llvm.org
Thu Mar 21 08:57:13 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 6295e677220bb6ec1fa8abe2f4a94b513b91b786 dc08bafe20106d535cb3b2b8ad8e663867259a89 -- libc/src/stdio/linux/rename.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/stdio/linux/rename.cpp b/libc/src/stdio/linux/rename.cpp
index afa025864f..379a6ef3c0 100644
--- a/libc/src/stdio/linux/rename.cpp
+++ b/libc/src/stdio/linux/rename.cpp
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "include/llvm-libc-macros/linux/fcntl-macros.h"
 #include "src/stdio/rename.h"
+#include "include/llvm-libc-macros/linux/fcntl-macros.h"
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
 #include "src/errno/libc_errno.h"
@@ -16,7 +16,8 @@
 namespace LIBC_NAMESPACE {
 
 LLVM_LIBC_FUNCTION(int, rename, (const char *oldpath, const char *newpath)) {
-  int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_renameat2, AT_FDCWD, oldpath, AT_FDCWD, newpath, 0);
+  int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_renameat2, AT_FDCWD, oldpath,
+                                              AT_FDCWD, newpath, 0);
 
   if (ret >= 0)
     return 0;

``````````

</details>


https://github.com/llvm/llvm-project/pull/86140


More information about the libc-commits mailing list