summaryrefslogtreecommitdiff
path: root/src/libc/select.c
diff options
context:
space:
mode:
authordzwdz2024-02-20 20:09:06 +0100
committerdzwdz2024-02-20 20:09:06 +0100
commit7f6686177af7279fb9465df25b2c1295ce1aeaa2 (patch)
tree0d98eaa36de4997c937454649d907e450f837968 /src/libc/select.c
parent4be1fd62131f7e186e6f92f1bb5a356dc1ac1951 (diff)
libc: better curl compat
I can now actually curl an entire page :^)
Diffstat (limited to 'src/libc/select.c')
-rw-r--r--src/libc/select.c6
1 files changed, 6 insertions, 0 deletions
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 */