[libc-commits] [libc] [libc] Fix remaining 32-bit time syscalls on 32-bit platforms (PR #203009)

via libc-commits libc-commits at lists.llvm.org
Wed Jun 10 08:24:13 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/__support/threads/linux/futex_utils.h libc/src/__support/time/linux/clock_settime.cpp libc/src/sys/select/linux/select.cpp libc/src/time/linux/nanosleep.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/src/__support/threads/linux/futex_utils.h b/libc/src/__support/threads/linux/futex_utils.h
index f53a2e75f..6beed0eab 100644
--- a/libc/src/__support/threads/linux/futex_utils.h
+++ b/libc/src/__support/threads/linux/futex_utils.h
@@ -59,10 +59,11 @@ public:
       __kernel_timespec ts64{};
       void *timeout_arg = nullptr;
       if (timeout) {
-        // In overlay mode on 32-bit platforms, the system timespec (which we use)
-        // may be 32-bit (8 bytes), while the kernel's __kernel_timespec (used by
-        // _time64 syscalls) is 64-bit (16 bytes). If they match, we can pass the
-        // pointer directly. Otherwise, we must convert to avoid stack corruption.
+        // In overlay mode on 32-bit platforms, the system timespec (which we
+        // use) may be 32-bit (8 bytes), while the kernel's __kernel_timespec
+        // (used by _time64 syscalls) is 64-bit (16 bytes). If they match, we
+        // can pass the pointer directly. Otherwise, we must convert to avoid
+        // stack corruption.
         if constexpr (sizeof(timespec) == sizeof(__kernel_timespec)) {
           timeout_arg = const_cast<timespec *>(&timeout->get_timespec());
         } else {

``````````

</details>


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


More information about the libc-commits mailing list