[libc-commits] [libc] [libc] Add utimensat syscall wrapper and entrypoint (PR #188347)

via libc-commits libc-commits at lists.llvm.org
Tue Mar 24 14:03:18 PDT 2026


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 origin/main HEAD --extensions h,cpp -- libc/src/__support/OSUtil/linux/syscall_wrappers/utimensat.h libc/src/sys/stat/linux/utimensat.cpp libc/src/sys/stat/utimensat.h libc/test/src/sys/stat/utimensat_test.cpp libc/include/llvm-libc-macros/linux/sys-stat-macros.h libc/src/sys/time/linux/utimes.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/libc/include/llvm-libc-macros/linux/sys-stat-macros.h b/libc/include/llvm-libc-macros/linux/sys-stat-macros.h
index 7c05296a2..046fa8f23 100644
--- a/libc/include/llvm-libc-macros/linux/sys-stat-macros.h
+++ b/libc/include/llvm-libc-macros/linux/sys-stat-macros.h
@@ -45,7 +45,7 @@
 #define S_IWOTH 00002
 #define S_IXOTH 00001
 
-#define UTIME_NOW  ((1L << 30) - 1L)
+#define UTIME_NOW ((1L << 30) - 1L)
 #define UTIME_OMIT ((1L << 30) - 2L)
 
 #endif // LLVM_LIBC_MACROS_LINUX_SYS_STAT_MACROS_H
diff --git a/libc/test/src/sys/stat/utimensat_test.cpp b/libc/test/src/sys/stat/utimensat_test.cpp
index ce763d3b7..e0753bf50 100644
--- a/libc/test/src/sys/stat/utimensat_test.cpp
+++ b/libc/test/src/sys/stat/utimensat_test.cpp
@@ -113,6 +113,7 @@ TEST_F(LlvmLibcUtimensatTest, UtimeNowAndOmit) {
   times[1].tv_sec = 0;
   times[1].tv_nsec = UTIME_OMIT;
 
-  ASSERT_THAT(LIBC_NAMESPACE::utimensat(AT_FDCWD, TEST_FILE, times, 0), Succeeds(0));
+  ASSERT_THAT(LIBC_NAMESPACE::utimensat(AT_FDCWD, TEST_FILE, times, 0),
+              Succeeds(0));
   ASSERT_THAT(LIBC_NAMESPACE::remove(TEST_FILE), Succeeds(0));
 }

``````````

</details>


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


More information about the libc-commits mailing list