From 7f6686177af7279fb9465df25b2c1295ce1aeaa2 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 20 Feb 2024 20:09:06 +0100 Subject: libc: better curl compat I can now actually curl an entire page :^) --- src/libc/select.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libc/select.c') diff --git a/src/libc/select.c b/src/libc/select.c index e3e95e4..20f7b71 100644 --- a/src/libc/select.c +++ b/src/libc/select.c @@ -21,6 +21,12 @@ select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct ti (void)timeout; FD_ZERO(exceptfds); if (countset(nfds, readfds) != 0) { + if (countset(nfds, readfds) == 1 && countset(nfds, writefds) == 0) { + /* special case: if you're only waiting for a single fd to become + * readable, just go ahead and read() it. + * curl compat. */ + return 1; + } return errno = ENOSYS, -1; } return countset(nfds, writefds); /* assume everything is ready for writing */ -- cgit v1.2.3