[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 19 07:51:00 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:

> Do you still prefer a separate implementation inside pause?

I do -- but we can wait to see if @michaelrj-google or @kaladron see it differently.

I think the consistency is worth a bit of repetition inside pause() (note the pause implementation will be much simpler as it doesn't need the asserts and just passes 0/nullptr everywhere). It also avoids the slightly unusual setup of one syscall wrapper depending on another.

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


More information about the libc-commits mailing list