Skip to content

Commit 72aa388

Browse files
[libc][poll] remove entrypoint for riscv (#125941)
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). Link: #125940 Fixes: #125118
1 parent 94d51fd commit 72aa388

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: libc/config/linux/riscv/entrypoints.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ set(TARGET_LIBC_ENTRYPOINTS
3333
libc.src.fcntl.openat
3434

3535
# poll.h entrypoints
36-
libc.src.poll.poll
36+
# TODO: https://github.com/llvm/llvm-project/issues/125940
37+
# libc.src.poll.poll
3738

3839
# sched.h entrypoints
3940
libc.src.sched.sched_get_priority_max

Diff for: libc/src/poll/linux/poll.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
namespace LIBC_NAMESPACE_DECL {
2222

2323
LLVM_LIBC_FUNCTION(int, poll, (pollfd * fds, nfds_t nfds, int timeout)) {
24+
int ret = 0;
2425

2526
#ifdef SYS_poll
26-
int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_poll, fds, nfds, timeout);
27+
ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_poll, fds, nfds, timeout);
2728
#elif defined(SYS_ppoll)
2829
timespec ts, *tsp;
2930
if (timeout >= 0) {
@@ -33,9 +34,10 @@ LLVM_LIBC_FUNCTION(int, poll, (pollfd * fds, nfds_t nfds, int timeout)) {
3334
} else {
3435
tsp = nullptr;
3536
}
36-
int ret =
37+
ret =
3738
LIBC_NAMESPACE::syscall_impl<int>(SYS_ppoll, fds, nfds, tsp, nullptr, 0);
3839
#else
40+
// TODO: https://github.com/llvm/llvm-project/issues/125940
3941
#error "SYS_ppoll_time64?"
4042
#endif
4143

0 commit comments

Comments
 (0)