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

Michael Jones via libc-commits libc-commits at lists.llvm.org
Wed Oct 14 11:51:14 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)
----------------
michaelrj-google wrote:

given that the ordering is important for safety on some systems, would it make sense to change the condition to `#if defined(SYS_ppoll_time64) && (sizeof(time_t) == sizeof(int64_t))` instead of changing this ordering?

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


More information about the libc-commits mailing list