[libc-commits] [libc] [libc] Fix pause build on riscv32 via ppoll wrapper (PR #231959)

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Mon Oct 26 00:58:48 PDT 2026


================
@@ -39,19 +39,19 @@ LIBC_INLINE ErrorOr<int> ppoll(struct pollfd *fds, nfds_t nfds,
   // signals. NSIG is the signal count, so NSIG / 8 gives the byte size.
   const size_t SIGSETSIZE = NSIG / 8;
 
-#if defined(SYS_ppoll_time64)
-  static_assert(
-      sizeof(time_t) == sizeof(int64_t),
-      "SYS_ppoll_time64 requires struct timespec with 64-bit members.");
-  return syscall_checked<int>(SYS_ppoll_time64, fds, nfds, tmo_p, sigmask,
-                              SIGSETSIZE);
-#elif defined(SYS_ppoll)
+#if defined(SYS_ppoll)
   static_assert(
       sizeof(timespec::tv_nsec) == sizeof(long),
       "This legacy syscall fallback is only safe on platforms where tv_nsec "
       "matches the register size (long). It is unsafe on 32-bit platforms "
       "with 64-bit tv_nsec.");
   return syscall_checked<int>(SYS_ppoll, fds, nfds, tmo_p, sigmask, SIGSETSIZE);
+#elif defined(SYS_ppoll_time64)
----------------
labath wrote:

Micheal is at the dev meeting this week, so it may take a while to respond.

FWIW, you're right about the wrapper deps. I agree that they are fine in some cases. I just don't think that makes sense here, because it invites the questions like:
- why is this wrapper different from other time_t handling wrappers
- what actually happens when you pass a 32-bit time here
- do we have callers that are passing 32-bit time_t's when they shoudln't

while in reality the only caller passes a null pointer for the timespec argument, so none of these issues apply to it.

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


More information about the libc-commits mailing list