From 81235ddc430fc1d593e08a8e5acb17f3cf60483f Mon Sep 17 00:00:00 2001 From: kilyanni Date: Thu, 23 Jul 2026 17:55:30 +0200 Subject: [PATCH] fix: don't fail exceptfds with ENOSYS, just zero them' --- .../cloudlibc/src/libc/sys/select/pselect.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libc-bottom-half/cloudlibc/src/libc/sys/select/pselect.c b/libc-bottom-half/cloudlibc/src/libc/sys/select/pselect.c index d555040e1..4c3353701 100644 --- a/libc-bottom-half/cloudlibc/src/libc/sys/select/pselect.c +++ b/libc-bottom-half/cloudlibc/src/libc/sys/select/pselect.c @@ -18,12 +18,13 @@ int pselect(int nfds, fd_set *restrict readfds, fd_set *restrict writefds, return -1; } - // This implementation does not support polling for exceptional - // conditions, such as out-of-band data on TCP sockets. - if (errorfds != NULL && errorfds->__nfds > 0) { - errno = ENOSYS; - return -1; - } + // wasix poll_oneoff has no exceptional-condition (POLLPRI) event type, so we + // cannot report out-of-band data. Rather than fail the whole call with ENOSYS + // (which breaks defensive callers like rsync that always pass an exceptfds + // set and only treat EBADF as fatal, so ENOSYS spins their select loop), + // ignore exceptfds and report that no descriptor is exceptional. + if (errorfds != NULL) + FD_ZERO(errorfds); // Replace NULL pointers by the empty set. fd_set empty;