Skip to content

Commit 173514f

Browse files
[libc] Disable epoll_pwait2 for now. (#99967)
This patch reverts #99781 and part of #99771 since `epoll_pwait2` is not in fact available on all supported systems. It is my opinion that we shouldn't provide a version of a function that doesn't perform as expected, which is why this revert needs to happen. The `epoll_pwait2` function can be reenabled when we have a way to check if it is available on the target system, tracking bug for that is #80060
1 parent a1359f5 commit 173514f

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

libc/config/linux/riscv/entrypoints.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ set(TARGET_LIBC_ENTRYPOINTS
228228
libc.src.sys.epoll.epoll_ctl
229229
libc.src.sys.epoll.epoll_pwait
230230
libc.src.sys.epoll.epoll_wait
231-
libc.src.sys.epoll.epoll_pwait2
231+
# TODO: Need to check if pwait2 is available before providing.
232+
# https://github.com/llvm/llvm-project/issues/80060
233+
# libc.src.sys.epoll.epoll_pwait2
232234

233235
# sys/mman.h entrypoints
234236
libc.src.sys.mman.madvise

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ set(TARGET_LIBC_ENTRYPOINTS
228228
libc.src.sys.epoll.epoll_ctl
229229
libc.src.sys.epoll.epoll_pwait
230230
libc.src.sys.epoll.epoll_wait
231-
libc.src.sys.epoll.epoll_pwait2
231+
# TODO: Need to check if pwait2 is available before providing.
232+
# https://github.com/llvm/llvm-project/issues/80060
233+
# libc.src.sys.epoll.epoll_pwait2
232234

233235
# sys/mman.h entrypoints
234236
libc.src.sys.mman.madvise

libc/src/sys/epoll/linux/epoll_pwait2.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,10 @@ namespace LIBC_NAMESPACE_DECL {
2525
LLVM_LIBC_FUNCTION(int, epoll_pwait2,
2626
(int epfd, struct epoll_event *events, int maxevents,
2727
const struct timespec *timeout, const sigset_t *sigmask)) {
28-
#ifdef SYS_epoll_pwait2
2928
int ret = LIBC_NAMESPACE::syscall_impl<int>(
3029
SYS_epoll_pwait2, epfd, reinterpret_cast<long>(events), maxevents,
3130
reinterpret_cast<long>(timeout), reinterpret_cast<long>(sigmask),
3231
NSIG / 8);
33-
#elif defined(SYS_epoll_pwait)
34-
// Convert nanoseconds to milliseconds, rounding up if there are remaining
35-
// nanoseconds
36-
long timeout_ms = static_cast<long>(timeout->tv_sec * 1000 +
37-
(timeout->tv_nsec + 999999) / 1000000);
38-
int ret = LIBC_NAMESPACE::syscall_impl<int>(
39-
SYS_epoll_pwait, epfd, reinterpret_cast<long>(events), maxevents,
40-
timeout_ms, reinterpret_cast<long>(sigmask), NSIG / 8);
41-
#else
42-
#error "epoll_pwait and epoll_pwait2 syscalls not available."
43-
#endif
4432

4533
// A negative return value indicates an error with the magnitude of the
4634
// value being the error code.

0 commit comments

Comments
 (0)