[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
Thu Nov 5 15:03:49 PST 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:

Still working through the review backlog, sorry for the delay. I'm okay with syscall wrappers calling each other if necessary, though in this case given that `linux_syscalls::pause` is only called by `pause.cpp` I think it makes more sense to change `pause.cpp` to call `linux_syscalls::ppoll` directly.

For the implementation of `linux_syscalls::ppoll` I'd prefer to have a compile error if neither syscall is defined to match the others.

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


More information about the libc-commits mailing list