Skip to content

[libc] Disable epoll_pwait2 for now. #99967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libc/config/linux/riscv/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.sys.epoll.epoll_ctl
libc.src.sys.epoll.epoll_pwait
libc.src.sys.epoll.epoll_wait
libc.src.sys.epoll.epoll_pwait2
# TODO: Need to check if pwait2 is available before providing.
# https://github.com/llvm/llvm-project/issues/80060
# libc.src.sys.epoll.epoll_pwait2

# sys/mman.h entrypoints
libc.src.sys.mman.madvise
Expand Down
4 changes: 3 additions & 1 deletion libc/config/linux/x86_64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.sys.epoll.epoll_ctl
libc.src.sys.epoll.epoll_pwait
libc.src.sys.epoll.epoll_wait
libc.src.sys.epoll.epoll_pwait2
# TODO: Need to check if pwait2 is available before providing.
# https://github.com/llvm/llvm-project/issues/80060
# libc.src.sys.epoll.epoll_pwait2

# sys/mman.h entrypoints
libc.src.sys.mman.madvise
Expand Down
12 changes: 0 additions & 12 deletions libc/src/sys/epoll/linux/epoll_pwait2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,10 @@ namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, epoll_pwait2,
(int epfd, struct epoll_event *events, int maxevents,
const struct timespec *timeout, const sigset_t *sigmask)) {
#ifdef SYS_epoll_pwait2
int ret = LIBC_NAMESPACE::syscall_impl<int>(
SYS_epoll_pwait2, epfd, reinterpret_cast<long>(events), maxevents,
reinterpret_cast<long>(timeout), reinterpret_cast<long>(sigmask),
NSIG / 8);
#elif defined(SYS_epoll_pwait)
// Convert nanoseconds to milliseconds, rounding up if there are remaining
// nanoseconds
long timeout_ms = static_cast<long>(timeout->tv_sec * 1000 +
(timeout->tv_nsec + 999999) / 1000000);
int ret = LIBC_NAMESPACE::syscall_impl<int>(
SYS_epoll_pwait, epfd, reinterpret_cast<long>(events), maxevents,
timeout_ms, reinterpret_cast<long>(sigmask), NSIG / 8);
#else
#error "epoll_pwait and epoll_pwait2 syscalls not available."
#endif

// A negative return value indicates an error with the magnitude of the
// value being the error code.
Expand Down
Loading