[libc-commits] [libc] [libc][poll] remove entrypoint for riscv (PR #125941)
via libc-commits
libc-commits at lists.llvm.org
Wed Feb 5 13:53:44 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Nick Desaulniers (nickdesaulniers)
<details>
<summary>Changes</summary>
riscv32 specifically doesn't provide EITHER SYS_poll or SYS_ppoll. We may be
able to reimplement poll in terms of syscalls to SYS_ppoll_time64, but will
leave that as a TODO for the future. (Such as when we want to be able to cross
compile for riscv32).
Fixes: #<!-- -->125118
---
Full diff: https://github.com/llvm/llvm-project/pull/125941.diff
2 Files Affected:
- (modified) libc/config/linux/riscv/entrypoints.txt (+2-1)
- (modified) libc/src/poll/linux/poll.cpp (+4-2)
``````````diff
diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt
index c405172c8a13b7..6e67ea559d57b0 100644
--- a/libc/config/linux/riscv/entrypoints.txt
+++ b/libc/config/linux/riscv/entrypoints.txt
@@ -33,7 +33,8 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.fcntl.openat
# poll.h entrypoints
- libc.src.poll.poll
+ # TODO: https://github.com/llvm/llvm-project/issues/125940
+ # libc.src.poll.poll
# sched.h entrypoints
libc.src.sched.sched_get_priority_max
diff --git a/libc/src/poll/linux/poll.cpp b/libc/src/poll/linux/poll.cpp
index 886e57ccd5942b..d7c195878ae127 100644
--- a/libc/src/poll/linux/poll.cpp
+++ b/libc/src/poll/linux/poll.cpp
@@ -21,9 +21,10 @@
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, poll, (pollfd * fds, nfds_t nfds, int timeout)) {
+ int ret = 0;
#ifdef SYS_poll
- int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_poll, fds, nfds, timeout);
+ ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_poll, fds, nfds, timeout);
#elif defined(SYS_ppoll)
timespec ts, *tsp;
if (timeout >= 0) {
@@ -33,9 +34,10 @@ LLVM_LIBC_FUNCTION(int, poll, (pollfd * fds, nfds_t nfds, int timeout)) {
} else {
tsp = nullptr;
}
- int ret =
+ ret =
LIBC_NAMESPACE::syscall_impl<int>(SYS_ppoll, fds, nfds, tsp, nullptr, 0);
#else
+// TODO: https://github.com/llvm/llvm-project/issues/125940
#error "SYS_ppoll_time64?"
#endif
``````````
</details>
https://github.com/llvm/llvm-project/pull/125941
More information about the libc-commits
mailing list